Browse Source

Ensure that widgets in prompt/alert are registered as children of prompt/alert

Marcus McLaughlin 15 years ago
parent
commit
744dc10f86

+ 2 - 0
desktop/core/static/js/Source/CCS/CCS.Desktop.Config.js

@@ -132,3 +132,5 @@ window.addEvent('domready', function(){
 		else if(window.getSelection) window.getSelection().removeAllRanges();
 	});
 });
+
+Selectors.Pseudo.widget = function() { return !! this.get("widget"); }; 

+ 4 - 1
desktop/core/static/js/Source/JFrameRenderers/CCS.JFrame.Alert.js

@@ -57,6 +57,9 @@ CCS.JFrame.addGlobalRenderers({
 				this.getWindow().hide();
 			} else {
 				var alert = this.alert(content.title, target);
+                                target.getElements(":widget").each(function(widget) {
+                                        widget.get("widget").register(widget.getParent(":widget").get("widget"));
+                                });
 				if (options) {
 					if (options.blankWindowWithError) {
 						alert.addEvent('destroy', function(){
@@ -82,4 +85,4 @@ CCS.JFrame.addGlobalRenderers({
 		return !jframe_renders;
 	}
 
-});
+});

+ 5 - 2
desktop/core/static/js/Source/JFrameRenderers/CCS.JFrame.Prompt.js

@@ -33,7 +33,7 @@ CCS.JFrame.addGlobalRenderers({
 
 		var target = new Element('div', {'class': 'jframe_prompt'}).hide().inject($(this));
 		this.fill(target, content);
-		target.show();
+                target.show();
 		var toolbar = target.getElements('.toolbar');
 		if (toolbar.length) toolbar.hide();
 
@@ -44,6 +44,9 @@ CCS.JFrame.addGlobalRenderers({
 		}, {
 			resizable: true
 		});
+                target.getElements(":widget").each(function(widget) {
+                        widget.get("widget").register(widget.getParent(":widget").get("widget"));
+                });
 		if (form) {
 			form.addEvent('submit', function(){
 				prompt.hide();
@@ -63,4 +66,4 @@ CCS.JFrame.addGlobalRenderers({
 		return true;
 	}
 
-});
+});