Commit c3658aaf authored by Iker Hurtado's avatar Iker Hurtado
Browse files

Bugfixing

parent 65c9c46d
Pipeline #93809 skipped with stage
......@@ -167,6 +167,9 @@ class AutocompleteMultiselectTextfield {
// check if the dropdown is unfolded and uncheck the checkbox if so
const itemCheckbox = this.listContainer.querySelector('input[data-value="'+value+'"]');
if (itemCheckbox) itemCheckbox.checked = false;
// Emit a value change event
this.element.dispatchEvent(new Event("change", {bubbles: true}));
}
......@@ -183,10 +186,13 @@ class AutocompleteMultiselectTextfield {
this.selectedValues.add(value);
this.selectedItemsBox.append(createSelectedItemLabel(value));
}
//console.log('_addValue: this.selectedValues', this.selectedValues)
if (this.selectListener) this.selectListener(value);
// Emit a value change event
this.element.dispatchEvent(new Event("change", {bubbles: true}));
function createSelectedItemLabel(value){
const label = document.createElement('span');
label.className = 'selectedItemLabel';
......
......@@ -103,14 +103,8 @@ class FilterPanel {
// The value change event in fields is handled at container level (event delegation pattern)
this.element.addEventListener('change', e => {
if (e.target.id !== 'space-group-dropdown-list') {
// console.log('change event', e);
if (this.addPropsChangeListener) this.addPropsChangeListener(this.getValues())
}
})
if (this.addPropsChangeListener) this.addPropsChangeListener(this.getValues())
});
/* code for the MaxMinSlider component testing
this.testSlider = this.element.querySelector('.test-slider');
......
......@@ -187,7 +187,6 @@ class NewSearchMod {
this.searchBox.removeElementORFormulaInSearchQuery(e)
});
this.formulaBox = new FormulaBox();
this.formulaBox.setAddFormulaListener(formula => {
if (formula.trim() !== ''){
......@@ -199,7 +198,6 @@ class NewSearchMod {
}
});
this.materialNameBox = new MaterialNameBox();
this.materialNameBox.setAddMaterialNameListener( name => {
if (name.trim() !== ''){
......@@ -210,14 +208,11 @@ class NewSearchMod {
this.materialNameBox.disableInput();
}
});
// add autocomplete functionality to the textfield
// this.materialNameBox.setAutocomplete();
this.filterPanel = new FilterPanel();
this.filterSidePanel.appendChild(this.filterPanel.element);
this.filterPanel.setPropsChangeListener( propsMap => {
//console.log('filterPanel.change Event propsMap: ', propsMap);
REACTIVE_SEARCH ? this.sendQuery() : this.materialList.invalidateSearch();
})
......
......@@ -307,8 +307,10 @@ class SearchBox{
addParentheses(isOpen){
if ( this.searchQuery.length > 0 && isOpen)
this.addItemInSearchQuery(this.currentOperator, 'S');
if ( isOpen && this.searchQuery.length > 0
&& this.searchQuery[this.searchQuery.length-1] !== 'NOT'){
this.addItemInSearchQuery(this.currentOperator, 'S');
}
this.addItemInSearchQuery( (isOpen ? '(' : ')'), 'P');
this.updateSearchQuery();
}
......@@ -316,8 +318,10 @@ class SearchBox{
addNOT(){
if ( this.searchQuery.length > 0)
if ( this.searchQuery.length > 0
&& this.searchQuery[this.searchQuery.length-1] !== '('){
this.addItemInSearchQuery(this.currentOperator, 'S');
}
this.addItemInSearchQuery( 'NOT', 'S');
this.updateSearchQuery();
}
......
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