diff options
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/qsearch.js | 9 | ||||
-rw-r--r-- | lib/scripts/toolbar.js | 2 |
2 files changed, 9 insertions, 2 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; diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js index 059a4ba5c..6d75215e0 100644 --- a/lib/scripts/toolbar.js +++ b/lib/scripts/toolbar.js @@ -72,7 +72,7 @@ function initToolbar(tbid,edid,tb, allowblock){ * @author Andreas Gohr <andi@splitbrain.org> */ function tb_format(btn, props, edid) { - var sample = props.title || props.sample; + var sample = props.sample || props.title; insertTags(edid, fixtxt(props.open), fixtxt(props.close), |