diff --git a/html_resources/selector.js b/html_resources/selector.js index 25cd7a0..2f1f4c3 100644 --- a/html_resources/selector.js +++ b/html_resources/selector.js @@ -6,13 +6,14 @@ function initDB(obj){ DB = obj; Object.defineProperty(DB,"query",{value:function (q,list){ let nlist = []; - for(let key of list || Object.keys(this)){ + for(let key of list || this.keys){ if(this[key].includes(q)){ nlist.push(key) } } return nlist }}); + Object.defineProperty(DB,"keys",{value:(Object.keys(DB).sort())}); return true }