[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: * Reuse open tabs if title is the same (#fixes 1211)

git at icinga.org git at icinga.org
Sun Mar 20 11:26:08 CET 2011


Module: icinga-web
Branch: jmosshammer/default
Commit: cbf1979d949125c5a639bfcb6357070edf7638e6
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=cbf1979d949125c5a639bfcb6357070edf7638e6

Author: jmosshammer <jmosshammer at debian.localhost>
Date:   Thu Feb 10 17:10:28 2011 +0100

* Reuse open tabs if title is the same (#fixes 1211)

---

 app/modules/Cronks/lib/js/CronkUtil.js |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/app/modules/Cronks/lib/js/CronkUtil.js b/app/modules/Cronks/lib/js/CronkUtil.js
index 435a870..dba9535 100755
--- a/app/modules/Cronks/lib/js/CronkUtil.js
+++ b/app/modules/Cronks/lib/js/CronkUtil.js
@@ -202,9 +202,18 @@ Cronk.util.InterGridUtil = function(){
 			if (!Ext.isDefined(config.iconCls)) {
 				config.iconCls = 'icinga-cronk-icon-cube';
 			}
-			
+		
 			if (!panel) {
+				for(var i=0;i<tabs.items.items.length;i++) {
 				
+					var item = tabs.items.items[i];	
+					if(item.title == config.title) {
+						panel = item;
+					}
+				}
+			}
+			if(!panel) {
+				config.id = config.parentid;
 				panel = Cronk.factory(config);					
 								
 				panel.on('add', function(p, c, i) {





More information about the icinga-checkins mailing list