portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r512152 - /portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js
Date Tue, 27 Feb 2007 06:29:17 GMT
Author: smilek
Date: Mon Feb 26 22:29:16 2007
New Revision: 512152

URL: http://svn.apache.org/viewvc?view=rev&rev=512152
Log:
added switches to disable window move (drag) and window resize via portlet decoration properties
(these switches are automatically set when viewing a portlet in print-mode)

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=512152&r1=512151&r2=512152
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js Mon Feb
26 22:29:16 2007
@@ -27,6 +27,7 @@
     dojo.widget.FloatingPane.call( this );
     this.widgetType = "PortletWindow";
     this.resizable = true;
+    this.movable = true;
     this.portletInitialized = false;
     this.actionButtons = {};
     this.actionMenus = {};
@@ -571,7 +572,13 @@
                 }
     
                 this.windowActionButtonSync();
+
+                if ( this.windowDecorationConfig.windowDisableResize )
+                    this.resizable =  false;
+                if ( this.windowDecorationConfig.windowDisableMove )
+                    this.movable =  false;
             }
+            
 
             // j2o - deletion - initialization of HtmlDragMoveSource and call to setDragHandle
             //                  equivalent is done in postCreate with PortletWindowDragMoveSource
@@ -965,12 +972,13 @@
     // dojo.widget.Widget create protocol
     postCreate: function( args, fragment, parentComp )
     {   // FloatingPane 0.3.1 essentially calls resizeTo - this is done in portletInitDimensions()
-        this.drag = new jetspeed.widget.PortletWindowDragMoveSource( this );
-        if ( this.constrainToContainer )
+        if ( this.movable )
         {
-            this.drag.constrainTo();
+            this.drag = new jetspeed.widget.PortletWindowDragMoveSource( this );
+            if ( this.constrainToContainer )
+                this.drag.constrainTo();
+            this.drag.setDragHandle( this.titleBar );
         }
-        this.drag.setDragHandle( this.titleBar );
         
         this.domNode.id = this.widgetId;  // BOZO: must set the id here - it gets defensively
cleared by dojo
         
@@ -1516,10 +1524,7 @@
         if ( ! this.windowIsSizing )
         {
             var resizeWidget = this.getResizeHandleWidget();
-            if ( ! resizeWidget )
-                dojo.raise( "PortletWindow cannot find its resize widget" );
-        
-            if ( resizeWidget._isSizing )
+            if ( resizeWidget != null && resizeWidget._isSizing )
             {
                 dojo.event.connect( resizeWidget, "_endSizing", this, "endSizing" );
                 // NOTE: connecting directly to document.body onmouseup results in notification
for second and subsequent onmouseup



---------------------------------------------------------------------
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