diff options
-rw-r--r-- | awesomplete.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/awesomplete.js b/awesomplete.js index a422d1b..2055fc5 100644 --- a/awesomplete.js +++ b/awesomplete.js @@ -120,6 +120,7 @@ _.prototype = { this._list = list.split(/\s*,\s*/); } else { // Element or CSS selector + console.log('list type unknown'); list = $(list); if (list && list.children) { @@ -159,6 +160,19 @@ _.prototype = { $.fire(this.input, "awesomplete-open"); }, + toggle: function () { + if (this.ul.childNodes.length == 0) { + this.minChars = 0; + this.evaluate(); + } + else if (this.ul.hasAttribute('hidden')) { + this.open(); + } + else { + this.close(); + } + }, + next: function () { var count = this.ul.children.length; |