From 73301e93cdbd8b9730fabe6230e5933e67d419f7 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 13 Aug 2009 11:47:02 -0600 Subject: [PATCH] Add Expand/Collapse All menu items to all collapsible folders --- imp/js/DimpBase.js | 16 +++++++++++++++- imp/templates/index/index-dimp.inc | 10 ++++++++-- imp/themes/screen-dimp.css | 4 ++-- imp/themes/silver/screen-dimp.css | 4 ++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 35a5c392c..2bb4bbdf5 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -639,7 +639,7 @@ var DimpBase = { contextOnClick: function(parentfunc, elt, baseelt, menu) { - var flag, id = elt.readAttribute('id'); + var flag, id = elt.readAttribute('id'), tmp; switch (id) { case 'ctx_folder_create': @@ -700,6 +700,16 @@ var DimpBase = { }.bind(this)); break; + case 'ctx_container_expand': + case 'ctx_container_collapse': + case 'ctx_folder_expand': + case 'ctx_folder_collapse': + tmp = baseelt.up('LI'); + [ tmp, $(this.getSubFolderId(tmp.readAttribute('id'))).select('LI.folder') ].flatten().each(function(f) { + this._toggleSubFolder(f, (id == 'ctx_container_expand' || id == 'ctx_folder_expand') ? 'exp' : 'col', true); + }.bind(this)); + break; + case 'ctx_message_spam': case 'ctx_message_ham': this.reportSpam(id == 'ctx_message_spam'); @@ -811,6 +821,10 @@ var DimpBase = { tmp = baseelt.hasAttribute('u'); [ $('ctx_folder_poll') ].invoke(tmp ? 'hide' : 'show'); [ $('ctx_folder_nopoll') ].invoke(tmp ? 'show' : 'hide'); + + tmp = $(this.getSubFolderId(baseelt.readAttribute('id'))); + $('ctx_folder_collapse', 'ctx_folder_expand').invoke(tmp ? 'show' : 'hide'); + [ $('ctx_folder_expand').previous() ].invoke(tmp ? 'addClassName' : 'removeClassName', 'sep'); break; case 'ctx_reply': diff --git a/imp/templates/index/index-dimp.inc b/imp/templates/index/index-dimp.inc index 4c4664ae5..62e9fcf3d 100644 --- a/imp/templates/index/index-dimp.inc +++ b/imp/templates/index/index-dimp.inc @@ -345,22 +345,28 @@ function _simpleButton($id, $text, $image, $imagedir = null) + + + +