From 0d65ce0deb9856532a442b3c95a43196ee01c7af Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 14 Sep 2009 15:23:48 -0600 Subject: [PATCH] A bit of UI niceness in DIMP for the basic search screen --- imp/js/DimpBase.js | 12 ++++++++++++ imp/search-basic.php | 4 +++- imp/templates/search/search-basic.html | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 78c73b9e6..8ded7140d 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -1778,6 +1778,17 @@ var DimpBase = { } }, + changeHandler: function(e) + { + var elt = e.element(); + + if (elt.readAttribute('name') == 'search_criteria' && + elt.descendantOf('RB_window')) { + elt.up().nextSiblings().invoke($F(elt) ? 'show' : 'hide'); + RedBox.setWindowPosition(); + } + }, + /* Handle rename folder actions. */ renameFolder: function(folder) { @@ -2467,6 +2478,7 @@ var DimpBase = { /* Register global handlers now. */ document.observe('keydown', this.keydownHandler.bindAsEventListener(this)); + document.observe('change', this.changeHandler.bindAsEventListener(this)); /* Limit to folders sidebar only. */ $('foldersSidebar').observe('mouseover', this.mouseoverHandler.bindAsEventListener(this)); diff --git a/imp/search-basic.php b/imp/search-basic.php index b02d35626..5d20d64ec 100644 --- a/imp/search-basic.php +++ b/imp/search-basic.php @@ -66,7 +66,9 @@ $t->set('search_title', sprintf(_("Search %s"), htmlspecialchars(IMP::displayFol $t->set('s_fields', $s_fields); $t->set('f_fields', $f_fields); -if (!$t->get('dimpview')) { +if ($t->get('dimpview')) { + $t->set('hide_criteria', true); +} else { $title = _("Search"); IMP::prepareMenu(); require IMP_TEMPLATES . '/common-header.inc'; diff --git a/imp/templates/search/search-basic.html b/imp/templates/search/search-basic.html index 2ef6cbc24..24d2cfcd5 100644 --- a/imp/templates/search/search-basic.html +++ b/imp/templates/search/search-basic.html @@ -17,10 +17,10 @@ - + style="display:none"> - + style="display:none"> -- 2.11.0