From: <ast...@hy...> - 2008-07-29 22:55:13
|
Author: astroganov Date: 2008-07-29 15:55:11 -0700 (Tue, 29 Jul 2008) New Revision: 10408 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=10408 Modified: trunk/web/js/lib/lib.js Log: limit the number of alert summary widget groups to 20 Modified: trunk/web/js/lib/lib.js =================================================================== --- trunk/web/js/lib/lib.js 2008-07-29 22:53:42 UTC (rev 10407) +++ trunk/web/js/lib/lib.js 2008-07-29 22:55:11 UTC (rev 10408) @@ -1425,6 +1425,8 @@ hyperic.dashboard.summaryWidget = function(node, portletName, portletLabel) { var that = this; + that.max_alerts = 20; + that.configSheet = dojo11.query('.config',node)[0]; that.contentSheet = dojo11.query('.content',node)[0]; @@ -1502,7 +1504,15 @@ // { // that.selected_alert_groups.push(that.available_alert_groups.options[that.available_alert_groups.selectedIndex].value); // } - that.moveAlert(that.available_alert_groups,that.enabled_alert_groups); + if(that.enabled_alert_groups.options.length < that.max_alerts) + { + that.moveAlert(that.available_alert_groups,that.enabled_alert_groups); + + if(that.enabled_alert_groups.options.length == that.max_alerts) + { + e.target.disabled = true; + } + } }; /** @@ -1529,6 +1539,12 @@ // ); // } that.moveAlert(that.enabled_alert_groups,that.available_alert_groups); + + enable_alert_btn = dojo11.query('.enable_alert_btn',that.configSheet)[0]; + if(enable_alert_btn.disabled == true) + { + enable_alert_btn.disabled = false; + } }; /** |