Commit 4f332b41 authored by Iker Hurtado's avatar Iker Hurtado
Browse files

Complex search logic implementation (1)

parent 815c0721
......@@ -410,7 +410,7 @@
let API_HOST= 'http://enc-staging-nomad.esc.rzg.mpg.de/';
let USER_COOKIE_DOMAIN = 'localhost';
let path = 'current/v1.0/'; // current development version of the API
// let path = 'v1.0/'; // stable staging
// let path = 'v1.0/'; // stable staging
// Case 2: production environment
if (document.location.href.indexOf('nomad-coe.eu') > 0){//
......@@ -7645,7 +7645,7 @@
// local utility functions
function getTagHtml(tag, isFormula){
return `<span class="search-label" data-el="${tag}" >
<img src="img/tag.svg" height="16px" class="remove-label"
<img src="img/${isFormula ? 'info' : 'tag'}.svg" height="16px" class="remove-label"
style="vertical-align: bottom"/>
${isFormula ? util.getSubscriptedFormula(tag) : tag}
<img src="img/cross.svg" height="6px" class="remove-label"
......@@ -7740,7 +7740,6 @@
this.elementTable= new ElementTable();
this.elementTable.setClickListener(elementArray => {
this.addElementsInSearchQuery(elementArray);
this.addFormulaButton.disabled = true; // Not always necessary but it simplifies the code
this.addMatNameButton.disabled = true; // Not always necessary but it simplifies the code
});
this.elementTable.setDeselectListener(e => this.removeElementORFormulaInSearchQuery(e));
......@@ -7750,7 +7749,6 @@
this.formulaBox.setAddFormulaListener(formula => {
if (formula.trim() !== ''){
this.addTagInSearchQuery(formula, 'F');
this.addElementButton.disabled = true;
this.addMatNameButton.disabled = true;
this.formulaBox.disable(true);
this.materialNameBox.disable(true);
......
......@@ -75,7 +75,7 @@ let ELEMENTS = [
let API_HOST= 'http://enc-staging-nomad.esc.rzg.mpg.de/';
let USER_COOKIE_DOMAIN = 'localhost';
let path = 'current/v1.0/'; // current development version of the API
// let path = 'v1.0/'; // stable staging
// let path = 'v1.0/'; // stable staging
// Case 2: production environment
if (document.location.href.indexOf('nomad-coe.eu') > 0){//
......
......@@ -38,7 +38,7 @@ let SwitchComponent = require('../common/SwitchComponent.js');
// local utility functions
function getTagHtml(tag, isFormula){
return `<span class="search-label" data-el="${tag}" >
<img src="img/tag.svg" height="16px" class="remove-label"
<img src="img/${isFormula ? 'info' : 'tag'}.svg" height="16px" class="remove-label"
style="vertical-align: bottom"/>
${isFormula ? util.getSubscriptedFormula(tag) : tag}
<img src="img/cross.svg" height="6px" class="remove-label"
......@@ -133,7 +133,6 @@ class NewSearchMod {
this.elementTable= new ElementTable();
this.elementTable.setClickListener(elementArray => {
this.addElementsInSearchQuery(elementArray);
this.addFormulaButton.disabled = true; // Not always necessary but it simplifies the code
this.addMatNameButton.disabled = true; // Not always necessary but it simplifies the code
});
this.elementTable.setDeselectListener(e => this.removeElementORFormulaInSearchQuery(e));
......@@ -143,7 +142,6 @@ class NewSearchMod {
this.formulaBox.setAddFormulaListener(formula => {
if (formula.trim() !== ''){
this.addTagInSearchQuery(formula, 'F');
this.addElementButton.disabled = true;
this.addMatNameButton.disabled = true;
this.formulaBox.disable(true);
this.materialNameBox.disable(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment