summaryrefslogtreecommitdiffstats
path: root/awesomplete.js
diff options
context:
space:
mode:
Diffstat (limited to 'awesomplete.js')
-rw-r--r--awesomplete.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/awesomplete.js b/awesomplete.js
index 5e85fc1..41f94ee 100644
--- a/awesomplete.js
+++ b/awesomplete.js
@@ -46,7 +46,7 @@ var _ = function (input, o) {
});
this.ul = $.create("ul", {
- hidden: "",
+ hidden: "hidden",
inside: this.container
});
@@ -96,14 +96,14 @@ var _ = function (input, o) {
}
if (li && evt.button === 0) { // Only select on left click
- me.select(li);
+ me.select(li, evt);
}
}
}});
if (this.input.hasAttribute("list")) {
- this.list = "#" + input.getAttribute("list");
- input.removeAttribute("list");
+ this.list = "#" + this.input.getAttribute("list");
+ this.input.removeAttribute("list");
}
else {
this.list = this.input.getAttribute("data-list") || o.list || [];
@@ -190,7 +190,7 @@ _.prototype = {
$.fire(this.input, "awesomplete-highlight");
},
- select: function (selected) {
+ select: function (selected, originalEvent) {
selected = selected || this.ul.children[this.index];
if (selected) {
@@ -200,7 +200,8 @@ _.prototype = {
text: selected.textContent,
preventDefault: function () {
prevented = true;
- }
+ },
+ originalEvent: originalEvent
});
if (!prevented) {