summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLea Verou <lea@verou.me>2016-08-27 15:08:46 +0300
committerGitHub <noreply@github.com>2016-08-27 15:08:46 +0300
commit92ddc9d920e7e252e3a3575475b6483460ff3f88 (patch)
tree8a45f3b2d5aa13ecab2dcf400fce0267294eadce
parente68744da0cc6caf6a2e109125598e09eba2c0fcb (diff)
parent7adb3ab7fffdc547b0a79bc68a7227427a016e0f (diff)
downloadawesomplete-92ddc9d920e7e252e3a3575475b6483460ff3f88.zip
awesomplete-92ddc9d920e7e252e3a3575475b6483460ff3f88.tar.gz
awesomplete-92ddc9d920e7e252e3a3575475b6483460ff3f88.tar.bz2
Merge pull request #16929 from Mrparkers/gh-pages
Change getter for `opened` property 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 cd634b3..367636e 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);