From 1a66868381f20590e58e2728fad4649d5141bd15 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 8 Oct 2009 11:51:33 -0600 Subject: [PATCH] Allow qsearch close icon to clear qsearch text --- imp/js/DimpBase.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 1220bc75e..11eb48407 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -1360,7 +1360,6 @@ var DimpBase = { this.viewport.reload(); } else { this.sfolder = this.folder; - $('qsearch_close').show(); this.loadMailbox(DIMP.conf.qsearchid); } }, @@ -1370,12 +1369,13 @@ var DimpBase = { { var f = this.folder; + $('qsearch_close').hide(); + if (!$('qsearch').hasClassName('qsearchFocus')) { + this._setQsearchText(true); + } + if (this.isSearch()) { - $('qsearch_close').hide(); DimpCore.DMenu.disable('qsearch_icon', true, false); - if (!$('qsearch').hasClassName('qsearchFocus')) { - this._setQsearchText(true); - } this.resetSelected(); $('qsearch_input').show(); if (!noload) { @@ -1391,6 +1391,7 @@ var DimpBase = { { $('qsearch_input').setValue(d ? DIMP.text.search + ' (' + $('ctx_qsearchopts_' + DIMP.conf.qsearchfield).getText() + ')' : ''); [ $('qsearch') ].invoke(d ? 'removeClassName' : 'addClassName', 'qsearchActive'); + $('qsearch_close').hide(); }, _basicSearchCallback: function(r) @@ -1504,6 +1505,12 @@ var DimpBase = { e.stop(); } break; + + default: + if (elt.readAttribute('id') == 'qsearch_input') { + $('qsearch_close').show(); + } + break; } return; -- 2.11.0