[richfaces-svn-commits] JBoss Rich Faces SVN: r9230 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Jun 25 13:31:41 EDT 2008


Author: nbelaevski
Date: 2008-06-25 13:31:41 -0400 (Wed, 25 Jun 2008)
New Revision: 9230

Modified:
   trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
Minor modal panel script update

Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js	2008-06-25 17:04:01 UTC (rev 9229)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js	2008-06-25 17:31:41 UTC (rev 9230)
@@ -158,22 +158,31 @@
 	},
 
 	width: function() {
-		return this.getContentElement().parentNode.clientWidth;
+		return this.getSizedElement().clientWidth;
 	},
 
 	height: function() {
-		return this.getContentElement().parentNode.clientHeight;
+		return this.getSizedElement().clientHeight;
 	},
 	
-	getContentElement: function() {
+	getSizedElement: function() {
 		if (!this._sizedElement) {
-			this._sizedElement = this.options.autosized ? $(this.contentTable) : $(this.contentDiv);
+			this._sizedElement = $(this.cdiv);
 		}
 
 		return this._sizedElement;
 	},
+
+	getContentElement: function() {
+		if (!this._contentElement) {
+			this._contentElement = this.options.autosized ? $(this.contentTable) : $(this.contentDiv);
+		}
+
+		return this._contentElement;
+	},
 	
 	destroy: function() {
+		this._contentElement = null;
 		this._sizedElement = null;
 
 		ModalPanel.panels = ModalPanel.panels.without(this);




More information about the richfaces-svn-commits mailing list