From 5786b7e9c9a9c4b73929c528230c129b5ba5ece3 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 18 Dec 2009 16:02:46 -0700 Subject: [PATCH] Clean up ham/spam button toggling --- imp/js/DimpBase.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index ed99c3c45..5c50266c2 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -520,6 +520,7 @@ var DimpBase = { container.observe('ViewPort:contentComplete', function(e) { var ssc, tmp, + ham = spam = 'show', l = this.viewport.getMetaData('label'); this.setMessageListTitle(); @@ -564,19 +565,18 @@ var DimpBase = { } if (this.folder == DIMP.conf.spam_mbox) { - if (!DIMP.conf.spam_spammbox && $('button_spam')) { - [ $('button_spam').up(), $('ctx_message_spam') ].invoke('hide'); - } - if ($('button_ham')) { - [ $('button_ham').up(), $('ctx_message_ham') ].invoke('show'); - } - } else { - if ($('button_spam')) { - [ $('button_spam').up(), $('ctx_message_spam') ].invoke('show'); - } - if ($('button_ham')) { - [ $('button_ham').up(), $('ctx_message_ham') ].invoke(DIMP.conf.ham_spammbox ? 'hide' : 'show'); + if (!DIMP.conf.spam_spammbox) { + spam = 'hide'; } + } else if (DIMP.conf.ham_spammbox) { + ham = 'hide'; + } + + if ($('button_ham')) { + [ $('button_ham').up(), $('ctx_message_ham') ].invoke(ham); + } + if ($('button_spam')) { + [ $('button_spam').up(), $('ctx_message_spam') ].invoke(spam); } /* Read-only changes. 'oa_setflag' is handled elsewhere. */ -- 2.11.0