Merge pull request #285 from RubenPX/fix/lots-search
hotfix lots search not working
This commit is contained in:
commit
78f9c269a8
|
@ -348,10 +348,12 @@ class lotsSearcher {
|
||||||
const lots = this.getListLots();
|
const lots = this.getListLots();
|
||||||
|
|
||||||
for (let i = 0; i < lots.length; i++) {
|
for (let i = 0; i < lots.length; i++) {
|
||||||
|
const lot = lots[i];
|
||||||
|
|
||||||
if (lot.innerText.toLowerCase().includes(inputSearch.toLowerCase())) {
|
if (lot.innerText.toLowerCase().includes(inputSearch.toLowerCase())) {
|
||||||
lot.parentElement.style.display = "";
|
lot.style.display = "";
|
||||||
} else {
|
} else {
|
||||||
lot.parentElement.style.display = "none";
|
lot.style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -363,7 +365,7 @@ _defineProperty(lotsSearcher, "lots", []);
|
||||||
_defineProperty(lotsSearcher, "lotsSearchElement", null);
|
_defineProperty(lotsSearcher, "lotsSearchElement", null);
|
||||||
|
|
||||||
_defineProperty(lotsSearcher, "getListLots", () => {
|
_defineProperty(lotsSearcher, "getListLots", () => {
|
||||||
let lotsList = document.getElementById("LotsSelector");
|
const lotsList = document.getElementById("LotsSelector");
|
||||||
|
|
||||||
if (lotsList) {
|
if (lotsList) {
|
||||||
// Apply filter to get only labels
|
// Apply filter to get only labels
|
||||||
|
|
|
@ -345,10 +345,11 @@ class lotsSearcher {
|
||||||
static doSearch(inputSearch) {
|
static doSearch(inputSearch) {
|
||||||
const lots = this.getListLots();
|
const lots = this.getListLots();
|
||||||
for (let i = 0; i < lots.length; i++) {
|
for (let i = 0; i < lots.length; i++) {
|
||||||
|
const lot = lots[i]
|
||||||
if (lot.innerText.toLowerCase().includes(inputSearch.toLowerCase())) {
|
if (lot.innerText.toLowerCase().includes(inputSearch.toLowerCase())) {
|
||||||
lot.parentElement.style.display = "";
|
lot.style.display = "";
|
||||||
} else {
|
} else {
|
||||||
lot.parentElement.style.display = "none";
|
lot.style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue