summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMrparkers <mparker@sourceallies.com>2016-08-08 16:58:12 -0500
committerMrparkers <mparker@sourceallies.com>2016-08-08 16:58:12 -0500
commit7adb3ab7fffdc547b0a79bc68a7227427a016e0f (patch)
treebebb03a6a0fd69eeff21b735c62576073286ec2e
parentb000c21454c8284a51074b8f95af97f05dfdd3c0 (diff)
downloadawesomplete-7adb3ab7fffdc547b0a79bc68a7227427a016e0f.zip
awesomplete-7adb3ab7fffdc547b0a79bc68a7227427a016e0f.tar.gz
awesomplete-7adb3ab7fffdc547b0a79bc68a7227427a016e0f.tar.bz2
Change getter for opened to use instance variable
-rw-r--r--awesomplete.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/awesomplete.js b/awesomplete.js
index 939eabb..a1d8233 100644
--- a/awesomplete.js
+++ b/awesomplete.js
@@ -12,6 +12,8 @@ var _ = function (input, o) {
// Setup
+ this.isOpened = false;
+
this.input = $(input);
this.input.setAttribute("autocomplete", "off");
this.input.setAttribute("aria-autocomplete", "list");
@@ -143,7 +145,7 @@ _.prototype = {
},
get opened() {
- return !this.ul.hasAttribute("hidden");
+ return this.isOpened;
},
close: function (o) {
@@ -152,6 +154,7 @@ _.prototype = {
}
this.ul.setAttribute("hidden", "");
+ this.isOpened = false;
this.index = -1;
$.fire(this.input, "awesomplete-close", o || {});
@@ -159,6 +162,7 @@ _.prototype = {
open: function () {
this.ul.removeAttribute("hidden");
+ this.isOpened = true;
if (this.autoFirst && this.index === -1) {
this.goto(0);