diff options
author | Stefan Parviainen <saparvia@caterva.eu> | 2015-01-07 18:42:57 +0100 |
---|---|---|
committer | Stefan Parviainen <saparvia@caterva.eu> | 2015-01-07 18:42:57 +0100 |
commit | e3d064ff22a69766226766557ff2a5b094c74e27 (patch) | |
tree | 2323191230e7f93f1b28bcad3891b1660adc6e93 /library/jquery-textcomplete | |
parent | 29e0bfee2f8e5a3e9a1d73f84c2c1f80b4637c3f (diff) | |
download | volse-hubzilla-e3d064ff22a69766226766557ff2a5b094c74e27.tar.gz volse-hubzilla-e3d064ff22a69766226766557ff2a5b094c74e27.tar.bz2 volse-hubzilla-e3d064ff22a69766226766557ff2a5b094c74e27.zip |
Allow textcomplete to work on inputs (PR also filed upstream)
Diffstat (limited to 'library/jquery-textcomplete')
-rw-r--r-- | library/jquery-textcomplete/jquery.textcomplete.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/library/jquery-textcomplete/jquery.textcomplete.js b/library/jquery-textcomplete/jquery.textcomplete.js index 1e61683ea..c8303eaa0 100644 --- a/library/jquery-textcomplete/jquery.textcomplete.js +++ b/library/jquery-textcomplete/jquery.textcomplete.js @@ -124,8 +124,9 @@ if (typeof jQuery === 'undefined') { this.views = []; this.option = $.extend({}, Completer._getDefaults(), option); - if (!this.$el.is('textarea') && !element.isContentEditable && element.contentEditable != 'true') { - throw new Error('textcomplete must be called on a Textarea or a ContentEditable.'); + + if (!this.$el.is('input[type=text]') && !this.$el.is('textarea') && !element.isContentEditable && element.contentEditable != 'true') { + throw new Error('textcomplete must be called on a input[type=text], Textarea or a ContentEditable.'); } if (element === document.activeElement) { @@ -171,7 +172,7 @@ if (typeof jQuery === 'undefined') { if (this.option.adapter) { Adapter = this.option.adapter; } else { - if (this.$el.is('textarea')) { + if (this.$el.is('textarea') || this.$el.is('input[type=text]')) { viewName = typeof element.selectionEnd === 'number' ? 'Textarea' : 'IETextarea'; } else { viewName = 'ContentEditable'; |