aboutsummaryrefslogtreecommitdiffstats
path: root/library/jquery-textcomplete/jquery.textcomplete.js
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2015-01-08 09:38:45 +1100
committerRedMatrix <info@friendica.com>2015-01-08 09:38:45 +1100
commit8771dee9cf90b9c8f76c1856ea7e5107aab5840e (patch)
tree0ab8af1ffb5a92962b2918e274cae26046897d11 /library/jquery-textcomplete/jquery.textcomplete.js
parenta373b9f1d4d0ee6781927c3fcf05e0e301a80b6e (diff)
parent7176eb88452b3c74652de09e44de41943051391c (diff)
downloadvolse-hubzilla-8771dee9cf90b9c8f76c1856ea7e5107aab5840e.tar.gz
volse-hubzilla-8771dee9cf90b9c8f76c1856ea7e5107aab5840e.tar.bz2
volse-hubzilla-8771dee9cf90b9c8f76c1856ea7e5107aab5840e.zip
Merge pull request #829 from pafcu/oneautocompleter
Steps towards a single autocompleter
Diffstat (limited to 'library/jquery-textcomplete/jquery.textcomplete.js')
-rw-r--r--library/jquery-textcomplete/jquery.textcomplete.js7
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';