Author: smilek
Date: Tue Feb  6 16:03:59 2007
New Revision: 504382

URL: http://svn.apache.org/viewvc?view=rev&rev=504382
Log:
moved jetspeed.om.portlet getCurrentWindowState() to 
PortletWindow.getCurrentWindowStateForPersistence; update for changes in 
ResizeHandle widget (_isSizing)

Modified:
    
portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js

Modified: 
portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js?view=diff&rev=504382&r1=504381&r2=504382
==============================================================================
--- 
portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js 
(original)
+++ 
portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js 
Tue Feb  6 16:03:59 2007
@@ -1492,9 +1492,9 @@
             if ( ! resizeWidget )
                 dojo.raise( "PortletWindow cannot find its resize widget" );
         
-            if ( resizeWidget.isSizing )
+            if ( resizeWidget._isSizing )
             {
-                dojo.event.connect( resizeWidget, "endSizing", this, 
"endSizing" );
+                dojo.event.connect( resizeWidget, "_endSizing", this, 
"endSizing" );
                 // NOTE: connecting directly to document.body onmouseup 
results in notification for second and subsequent onmouseup
                 this.windowIsSizing = true;
             }
@@ -1627,6 +1627,37 @@
             }
         }
         return cWinState;
+    },
+    getCurrentWindowStateForPersistence: function( /* boolean */ volatileOnly )
+    {
+        var currentState = null;
+        if ( volatileOnly )
+            currentState = this.getCurrentVolatileWindowState();
+        else
+            currentState = this.getCurrentWindowState();
+
+        // get rid of units text
+        this._purifyWindowStatePropertyAsNumber( currentState, "left" );
+        this._purifyWindowStatePropertyAsNumber( currentState, "top" );
+        this._purifyWindowStatePropertyAsNumber( currentState, "width" );
+        this._purifyWindowStatePropertyAsNumber( currentState, "height" );
+
+        return currentState;
+    },
+    _purifyWindowStatePropertyAsNumber: function( windowState, propName )
+    {
+        var source = windowState[ propName ];
+        if ( source != null )
+        {
+            var sourceNum = "";
+            for ( var i = 0 ; i < source.length ; i++ )
+            {
+                var sourceCh = source.charAt(i);
+                if ( ( sourceCh >= "0" && sourceCh <= "9" ) || sourceCh == "." 
)
+                    sourceNum += sourceCh.toString();
+            }
+            windowState[ propName ] = sourceNum;
+        }
     },
     setPortletContent: function( html, url )
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to