diff options
author | Git <git@what.cd> | 2013-09-02 08:00:37 +0000 |
---|---|---|
committer | Git <git@what.cd> | 2013-09-02 08:00:37 +0000 |
commit | f269fa54549295ccedcdfa341090249527fc69b6 (patch) | |
tree | 4568689f87b66c14d3121a26f0d9b3a333b12c84 /static/functions/jquery.autocomplete.js | |
parent | 25bf6fe0e981c39993436ba852d956e4c4b7a0e4 (diff) | |
download | Gazelle-f269fa54549295ccedcdfa341090249527fc69b6.zip Gazelle-f269fa54549295ccedcdfa341090249527fc69b6.tar.gz Gazelle-f269fa54549295ccedcdfa341090249527fc69b6.tar.bz2 |
Empty commit
Diffstat (limited to 'static/functions/jquery.autocomplete.js')
-rw-r--r-- | static/functions/jquery.autocomplete.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/static/functions/jquery.autocomplete.js b/static/functions/jquery.autocomplete.js index 3bbf9ba..d7fd96a 100644 --- a/static/functions/jquery.autocomplete.js +++ b/static/functions/jquery.autocomplete.js @@ -180,6 +180,7 @@ that.el.on('blur.autocomplete', function () { that.onBlur(); }); that.el.on('focus.autocomplete', function () { that.fixPosition(); }); that.el.on('change.autocomplete', function (e) { that.onKeyUp(e); }); + that.el.on('paste.autocomplete', function () { that.onPaste(); }); }, onBlur: function () { @@ -355,7 +356,7 @@ that.findBestHint(); if (that.options.deferRequestBy > 0) { // Defer lookup in case when value changes very quickly: - that.onChangeInterval = setInterval(function () { + that.onChangeInterval = setTimeout(function () { that.onValueChange(); }, that.options.deferRequestBy); } else { @@ -364,6 +365,23 @@ } }, + onPaste: function () { + var that = this; + + if (that.disabled) { + return; + } + + clearInterval(that.onChangeInterval); + + setTimeout(function () { + if (that.currentValue !== that.el.val()) { + that.findBestHint(); + that.onValueChange(); + } + }, 100); + }, + onValueChange: function () { var that = this, q; |