[icinga-checkins] icinga.org: icinga-web/mfriedrich/fixes: * Fixed crashes when switching tabs quickly

git at icinga.org git at icinga.org
Wed Mar 30 11:14:02 CEST 2011


Module: icinga-web
Branch: mfriedrich/fixes
Commit: 40ea52a2f5669e5c1bd431d9578a63b02e88c3a8
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=40ea52a2f5669e5c1bd431d9578a63b02e88c3a8

Author: jmosshammer <jannis.mosshammer at netways.de>
Date:   Sun Mar 20 13:24:54 2011 +0100

* Fixed crashes when switching tabs quickly

---

 app/modules/Cronks/lib/js/grid/GridPanel.js        |    6 ++++--
 .../Cronks/templates/System/js/JitStatusMap.js     |    6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/modules/Cronks/lib/js/grid/GridPanel.js b/app/modules/Cronks/lib/js/grid/GridPanel.js
index 7a005c3..90f2cc9 100755
--- a/app/modules/Cronks/lib/js/grid/GridPanel.js
+++ b/app/modules/Cronks/lib/js/grid/GridPanel.js
@@ -14,10 +14,12 @@ Cronk.grid.GridPanel = Ext.extend(Ext.grid.GridPanel, {
 			// Add nodata background
 			this.store.on('datachanged', function(store) {
 				if (store.getCount() == 0) {
-					_G.getGridEl().child('div').addClass('x-icinga-nodata');
+					if(_G.getGridEl())
+						_G.getGridEl().child('div').addClass('x-icinga-nodata');
 				}
 				else {
-					_G.getGridEl().child('div').removeClass('x-icinga-nodata');
+					if(_G.getGridEl())
+						_G.getGridEl().child('div').removeClass('x-icinga-nodata');
 				}
 			});
 		}		
diff --git a/app/modules/Cronks/templates/System/js/JitStatusMap.js b/app/modules/Cronks/templates/System/js/JitStatusMap.js
index ce97b9c..b4e7048 100755
--- a/app/modules/Cronks/templates/System/js/JitStatusMap.js
+++ b/app/modules/Cronks/templates/System/js/JitStatusMap.js
@@ -50,9 +50,9 @@ function JitStatusMap (config) {
 
 	function jitInit (json, elementIds) {
 		var infovis = document.getElementById(elementIds.jitMap);
-		
-		var panel = Ext.DomQuery.selectNode('.x-panel-body',infovis);	
-		
+		if(!infovis)
+			return true;
+		var panel = Ext.DomQuery.selectNode('.x-panel-body',infovis);		
 		if(panel) {
 			var pElem = Ext.get(panel);
 			pElem.setHeight(infovis.offsetHeight);





More information about the icinga-checkins mailing list