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

git at icinga.org git at icinga.org
Wed Mar 30 11:31:49 CEST 2011


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

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  |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/app/modules/Cronks/templates/System/PortalViewSuccess.php b/app/modules/Cronks/templates/System/PortalViewSuccess.php
index 8589185..047cdb7 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,7 +272,11 @@ 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) {
@@ -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