[icinga-checkins] icinga.org: icinga-web/master: * Fixed missing parameters in drag-> portal action, fixed saved portal cronk restoration

git at icinga.org git at icinga.org
Wed Mar 23 15:51:53 CET 2011


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

Author: jmosshammer <jannis.mosshammer at netways.de>
Date:   Wed Mar 23 15:57:24 2011 +0100

* Fixed missing parameters in drag->portal action, fixed saved portal cronk restoration

---

 .../Cronks/templates/System/PortalViewSuccess.php  |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/app/modules/Cronks/templates/System/PortalViewSuccess.php b/app/modules/Cronks/templates/System/PortalViewSuccess.php
index 8589185..63c196b 100755
--- a/app/modules/Cronks/templates/System/PortalViewSuccess.php
+++ b/app/modules/Cronks/templates/System/PortalViewSuccess.php
@@ -15,6 +15,7 @@ Cronk.util.initEnvironment(<?php CronksRequestUtil::echoJsonString($rd); ?>, fun
 					portlet.on('afterlayout',function(ct) {
 						
 						var params = ct.initialConfig.params;
+				;
 						params["stateuid"] = ct.stateuid;
 						params["p[stateuid]"] = ct.stateuid,
 						params["p[parentid]"] = ct.id;
@@ -97,13 +98,14 @@ Cronk.util.initEnvironment(<?php CronksRequestUtil::echoJsonString($rd); ?>, fun
 									action: 'System.PortalView',
 									'p[parentid]': id
 								};
-								
-								if (data.dragData.parameter) {
+								data.dragData.parameter = data.dragData.parameter || {};
+								if (Ext.apply(data.dragData.parameter, data.dragData["ae:parameter"] || {})) {
 									for (var k in data.dragData.parameter) {
 										params['p[' + k + ']'] = data.dragData.parameter[k];
 									}
 								}
 								
+
 								var portlet  = Cronk.factory({
 									id: Ext.id(),
 
@@ -270,10 +272,14 @@ Cronk.util.initEnvironment(<?php CronksRequestUtil::echoJsonString($rd); ?>, fun
 				},
 
 				applyState: function (state) {
-				
+					// Prevent multiple state restores
+					if(this.appliedState)
+						return true;
+					else
+						this.appliedState = true;
 					// Defered execution
 					(function() {
-						if (state.col) {
+						if (state.col) {i
 							Ext.each(state.col, function (item, index, arry) {
 								Ext.iterate(item, function (key, citem, o) {
 									var c = citem;
@@ -283,7 +289,7 @@ Cronk.util.initEnvironment(<?php CronksRequestUtil::echoJsonString($rd); ?>, fun
 									var cronk = Cronk.factory(c);
 						
 									PortalHandler.initPortlet(cronk);
-
+									AppKit.log("adding ",cronk);	
 									this.get(index).add(cronk);
 
 									cronk.show();
@@ -311,4 +317,4 @@ Cronk.util.initEnvironment(<?php CronksRequestUtil::echoJsonString($rd); ?>, fun
 		CE.doLayout();
 
 	});	
-</script>
\ No newline at end of file
+</script>





More information about the icinga-checkins mailing list