diff options
author | portix <portix@gmx.net> | 2014-03-10 03:09:06 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2014-03-10 03:09:06 +0100 |
commit | 8d4565114e66900f972e64f3a5131b125449b4fd (patch) | |
tree | ba09b2acab3326325175d29b389636155f27a959 | |
parent | 841801ab61f1c21b6eac0c8915cfc710d5b13b46 (diff) | |
download | dwb-8d4565114e66900f972e64f3a5131b125449b4fd.zip |
completion: use the _data-array index as data-id
-rw-r--r-- | scripts/modules/completion | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/scripts/modules/completion b/scripts/modules/completion index f0f80cc0..344a27c6 100644 --- a/scripts/modules/completion +++ b/scripts/modules/completion @@ -110,7 +110,7 @@ function injectable() { textContent : tab.rightLabel || "", className : "label right" }); - element.dataset.id = tab.id; + element.dataset.id = i; return element; }); select(); @@ -196,14 +196,7 @@ Object.defineProperties(Completion.prototype, { _getSelected : { value : function() { var id = JSON.parse(mWidget.inject("return getSelected()")); - var item = null; - this._data.some(function(i) { - if (i.id == id) { - item = i; - return true - } - return false; - }); + var item = this._data[id]; if (item) { this.onSelected(item); } |