Move qsearch field selection into submenu
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 20 Oct 2009 18:30:04 +0000 (12:30 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 20 Oct 2009 22:16:30 +0000 (16:16 -0600)
imp/js/DimpBase.js
imp/templates/index/index-dimp.inc

index 9fc7ddd..2baa99b 100644 (file)
@@ -806,12 +806,12 @@ var DimpBase = {
             this.go('search', tmp);
             break;
 
-        case 'ctx_qsearchopts_all':
-        case 'ctx_qsearchopts_body':
-        case 'ctx_qsearchopts_from':
-        case 'ctx_qsearchopts_to':
-        case 'ctx_qsearchopts_subject':
-            DIMP.conf.qsearchfield = id.substring(16);
+        case 'ctx_qsearchby_all':
+        case 'ctx_qsearchby_body':
+        case 'ctx_qsearchby_from':
+        case 'ctx_qsearchby_to':
+        case 'ctx_qsearchby_subject':
+            DIMP.conf.qsearchfield = id.substring(14);
             this._updatePrefs('dimp_qsearch_field', DIMP.conf.qsearchfield);
             if (!$('qsearch').hasClassName('qsearchActive')) {
                 this._setQsearchText(true);
@@ -886,7 +886,7 @@ var DimpBase = {
             tmp.compact().invoke(this.viewport.getSelected().size() ? 'show' : 'hide');
             break;
 
-        case 'ctx_qsearchopts':
+        case 'ctx_qsearchby':
             $(ctx_id).descendants().invoke('removeClassName', 'contextSelected');
             $(ctx_id + '_' + DIMP.conf.qsearchfield).addClassName('contextSelected');
             break;
@@ -1388,7 +1388,7 @@ var DimpBase = {
     // d = (boolean) Deactivate quicksearch input?
     _setQsearchText: function(d)
     {
-        $('qsearch_input').setValue(d ? DIMP.text.search + ' (' + $('ctx_qsearchopts_' + DIMP.conf.qsearchfield).getText() + ')' : '');
+        $('qsearch_input').setValue(d ? DIMP.text.search + ' (' + $('ctx_qsearchby_' + DIMP.conf.qsearchfield).getText() + ')' : '');
         [ $('qsearch') ].invoke(d ? 'removeClassName' : 'addClassName', 'qsearchActive');
         $('qsearch_close').hide();
     },
@@ -2574,6 +2574,7 @@ var DimpBase = {
         if ($('qsearch')) {
             $('qsearch_input').observe('blur', this._quicksearchOnBlur.bind(this));
             this._addMouseEvents({ id: 'qsearch_icon', left: true, offset: 'qsearch', type: 'qsearchopts' });
+            DM.addSubMenu('ctx_qsearchopts_by', 'ctx_qsearchby');
         }
 
         /* Start message list loading as soon as possible. */
index c70811d..cf341fa 100644 (file)
@@ -442,13 +442,17 @@ function _simpleButton($id, $text, $image)
 
 <?php if ($_SESSION['imp']['protocol'] != 'pop'): ?>
 <div class="context" id="ctx_qsearchopts" style="display:none">
+ <a id="ctx_qsearchopts_by" class="sep"><?php echo _("Search By") ?></a>
  <a id="ctx_qsearchopts_basic"><?php echo _("Basic Search...") ?></a>
- <a id="ctx_qsearchopts_advanced" class="sep"><?php echo _("Advanced Search...") ?></a>
- <a id="ctx_qsearchopts_all"><?php echo _("Entire Message") ?></a>
- <a id="ctx_qsearchopts_body"><?php echo _("Body") ?></a>
- <a id="ctx_qsearchopts_from"><?php echo _("From") ?></a>
- <a id="ctx_qsearchopts_to"><?php echo _("To") ?></a>
- <a id="ctx_qsearchopts_subject"><?php echo _("Subject") ?></a>
+ <a id="ctx_qsearchopts_advanced"><?php echo _("Advanced Search...") ?></a>
+</div>
+
+<div class="context" id="ctx_qsearchby" style="display:none">
+ <a id="ctx_qsearchby_all"><?php echo _("Entire Message") ?></a>
+ <a id="ctx_qsearchby_body"><?php echo _("Body") ?></a>
+ <a id="ctx_qsearchby_from"><?php echo _("From") ?></a>
+ <a id="ctx_qsearchby_to"><?php echo _("To") ?></a>
+ <a id="ctx_qsearchby_subject"><?php echo _("Subject") ?></a>
 </div>
 <?php endif; ?>