diff --git a/app/static/js/corpus-analysis/query-builder/token-attribute-builder-functions.js b/app/static/js/corpus-analysis/query-builder/token-attribute-builder-functions.js index 6bbc20f0..9633583b 100644 --- a/app/static/js/corpus-analysis/query-builder/token-attribute-builder-functions.js +++ b/app/static/js/corpus-analysis/query-builder/token-attribute-builder-functions.js @@ -102,36 +102,12 @@ nopaque.corpus_analysis.query_builder.TokenAttributeBuilderFunctions = class Tok notSelectedButton.parentNode.removeChild(notSelectedButton); this.elements.tokenQuery.appendChild(tokenQueryTemplateClone); - // Deleting the options which do not make sense in the context of the condition like "word" AND "word". Also sets selection default. - let selectionDefault = "word"; - let optionDeleteList = ['empty-token']; - if (conditionText === 'and') { - switch (this.elements.positionalAttrSelection.value) { - case 'english-pos' || 'german-pos': - optionDeleteList.push('english-pos', 'german-pos'); - break; - default: - optionDeleteList.push(this.elements.positionalAttrSelection.value); - break; - } - } else { - let originalSelectionList = - ` - - - - - - `; - this.elements.positionalAttrSelection.innerHTML = originalSelectionList; - M.FormSelect.init(this.elements.positionalAttrSelection); - } let lastTokenQueryRow = this.elements.tokenQuery.lastElementChild; if(lastTokenQueryRow.querySelector('[data-kind-of-token="word"]') || lastTokenQueryRow.querySelector('[data-kind-of-token="lemma"]')) { this.appendIgnoreCaseCheckbox(lastTokenQueryRow.querySelector('.token-query-template-content'), this.elements.ignoreCaseCheckbox.checked); } this.elements.ignoreCaseCheckbox.checked = false; - this.setTokenSelection(selectionDefault, optionDeleteList); + this.setTokenSelection(); } deleteTokenQueryRow(deleteButton) { @@ -169,7 +145,7 @@ nopaque.corpus_analysis.query_builder.TokenAttributeBuilderFunctions = class Tok } } - setTokenSelection(selection, optionDeleteList) { + setTokenSelection(selection="word", optionDeleteList=['empty-token']) { optionDeleteList.forEach(option => { if (this.elements.positionalAttrSelection.querySelector(`option[value=${option}]`) !== null) { this.elements.positionalAttrSelection.querySelector(`option[value=${option}]`).remove();