From 998e24967f67b19eaa541a0006ad254a31daee83 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 2 Feb 2010 01:07:55 -0700 Subject: [PATCH] Show alert log count in dimp --- imp/js/DimpBase.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 4c7e140b9..2b3ef0172 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -1682,6 +1682,13 @@ var DimpBase = { } }, + /* Growler handler */ + alertsloglinkUpdate: function() + { + var lsize = DimpCore.Growler.logSize(); + $('alertsloglink').down('A').update((DimpCore.Growler.logVisible() ? DIMP.text.hidealog : DIMP.text.showalog) + (lsize ? (' (' + DimpCore.Growler.logSize() + ')') : '')); + }, + /* Keydown event handler */ keydownHandler: function(e) { @@ -1965,7 +1972,8 @@ var DimpBase = { return; case 'alertsloglink': - $('alertsloglink').down('A').update(DimpCore.Growler.toggleLog() ? DIMP.text.hidealog : DIMP.text.showalog); + DimpCore.Growler.toggleLog(); + this.alertsloglinkUpdate(); break; case 'applyfilterlink': @@ -3147,10 +3155,13 @@ DimpCore.onDoActionComplete = function(r) { /* Click handler. */ DimpCore.clickHandler = DimpCore.clickHandler.wrap(DimpBase.clickHandler.bind(DimpBase)); -/* ContextSensitive functions. */ +/* ContextSensitive handlers. */ DimpCore.contextOnClick = DimpCore.contextOnClick.wrap(DimpBase.contextOnClick.bind(DimpBase)); DimpCore.contextOnShow = DimpCore.contextOnShow.wrap(DimpBase.contextOnShow.bind(DimpBase)); +/* Growler listener. */ +document.observe('Growler:created', DimpBase.alertsloglinkUpdate.bind(DimpBase)); + /* Extend AJAX exception handling. */ DimpCore.doActionOpts.onException = DimpCore.doActionOpts.onException.wrap(DimpBase.onAjaxException.bind(DimpBase)); -- 2.11.0