diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-02-16 23:08:08 +0100 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-02-16 23:08:08 +0100 |
commit | e57cf65d092c1a6458c3a468b017018905018eeb (patch) | |
tree | cb06ff0cf82afed514aa95c5c33e5faef8a9ef62 /lib/scripts/qsearch.js | |
parent | a0e625181ad2e2369e8db0e5691f7356363776d0 (diff) | |
parent | 9bbf02e86e5c1181bbc288ce42f1937f309a7e79 (diff) | |
download | rpg-e57cf65d092c1a6458c3a468b017018905018eeb.tar.gz rpg-e57cf65d092c1a6458c3a468b017018905018eeb.tar.bz2 |
Merge remote-tracking branch 'origin/master' into authpluginconfig
Diffstat (limited to 'lib/scripts/qsearch.js')
-rw-r--r-- | lib/scripts/qsearch.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/scripts/qsearch.js b/lib/scripts/qsearch.js index 0c3609ada..e5cc73b49 100644 --- a/lib/scripts/qsearch.js +++ b/lib/scripts/qsearch.js @@ -12,6 +12,7 @@ var dw_qsearch = { $inObj: null, $outObj: null, timer: null, + curRequest: null, /** * initialize the quick search @@ -35,12 +36,16 @@ var dw_qsearch = { // attach eventhandler to search field do_qsearch = function () { + // abort any previous request + if (dw_qsearch.curRequest != null) { + dw_qsearch.curRequest.abort(); + } var value = dw_qsearch.$inObj.val(); if (value === '') { dw_qsearch.clear_results(); return; } - jQuery.post( + dw_qsearch.curRequest = jQuery.post( DOKU_BASE + 'lib/exe/ajax.php', { call: 'qsearch', @@ -84,6 +89,8 @@ var dw_qsearch = { onCompletion: function(data) { var max, $links, too_big; + dw_qsearch.curRequest = null; + if (data === '') { dw_qsearch.clear_results(); return; |