portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r504382 - /portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js
Date Wed, 07 Feb 2007 00:04:00 GMT
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: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message