From: Michael M Slusarz Date: Thu, 25 Feb 2010 05:15:00 +0000 (-0700) Subject: Hide flag menus if no flags are settable X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ebd2d943c73d091e889c70b6a7ceb9afc2a40816;p=horde.git Hide flag menus if no flags are settable --- diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index d45414db0..d80a97e7e 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -612,9 +612,12 @@ var DimpBase = { /* Context menu: generate the list of settable flags for this * mailbox. */ flags = this.viewport.getMetaData('flags'); - $('ctx_flag').childElements().each(function(c) { - [ c ].invoke(flags.include(c.readAttribute('flag')) ? 'show' : 'hide'); - }); + $('ctx_draft_setflag', 'ctx_message_setflag', 'oa_setflag').invoke('up').invoke(flags.size() ? 'show' : 'hide'); + if (flags.size()) { + $('ctx_flag').childElements().each(function(c) { + [ c ].invoke(flags.include(c.readAttribute('flag')) ? 'show' : 'hide'); + }); + } }.bindAsEventListener(this)); container.observe('ViewPort:deselect', function(e) { diff --git a/imp/templates/index/index-dimp.inc b/imp/templates/index/index-dimp.inc index 1e1a425c4..6c15d88fe 100644 --- a/imp/templates/index/index-dimp.inc +++ b/imp/templates/index/index-dimp.inc @@ -366,12 +366,14 @@ function _simpleButton($id, $text, $image, $nodisplay = false)