summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2014-03-10 03:09:06 +0100
committerportix <portix@gmx.net>2014-03-10 03:09:06 +0100
commit8d4565114e66900f972e64f3a5131b125449b4fd (patch)
treeba09b2acab3326325175d29b389636155f27a959
parent841801ab61f1c21b6eac0c8915cfc710d5b13b46 (diff)
downloaddwb-8d4565114e66900f972e64f3a5131b125449b4fd.zip
completion: use the _data-array index as data-id
-rw-r--r--scripts/modules/completion11
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);
}