Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
encyclopedia-gui
Commits
c3658aaf
Commit
c3658aaf
authored
Feb 18, 2021
by
Iker Hurtado
Browse files
Bugfixing
parent
65c9c46d
Pipeline
#93809
skipped with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
client/src/search-mod/AutocompleteMultiselectTextfield.js
View file @
c3658aaf
...
...
@@ -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
'
;
...
...
client/src/search-mod/FilterPanel.view.js
View file @
c3658aaf
...
...
@@ -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');
...
...
client/src/search-mod/NewSearchMod.js
View file @
c3658aaf
...
...
@@ -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
();
})
...
...
client/src/search-mod/SearchBox.view.js
View file @
c3658aaf
...
...
@@ -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
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment