Author: mgrigorov
Date: Sun Nov 28 10:29:53 2010
New Revision: 1039861

URL: http://svn.apache.org/viewvc?rev=1039861&view=rev
Log:
WICKET-3170 ModalWindow moved event (besides resize)

Merge r1035216 from 1.4.x

Modified:
    
wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js

Modified: 
wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js?rev=1039861&r1=1039860&r2=1039861&view=diff
==============================================================================
--- 
wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
 (original)
+++ 
wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
 Sun Nov 28 10:29:53 2010
@@ -930,19 +930,30 @@ Wicket.Window.prototype = { 
         */     
        onMove: function(object, deltaX, deltaY) {
                var w = this.window;
-               var x = parseInt(w.style.left, 10) + deltaX;
-               var y = parseInt(w.style.top, 10) + deltaY;
+               this.left_ = parseInt(w.style.left, 10) + deltaX;
+               this.top_ = parseInt(w.style.top, 10) + deltaY;
                
-               if (x < 0)
-                       x = 0;
-               if (y < 0)
-                       y = 0;                                                  
+               if (this.left_ < 0) {
+                       this.left_ = 0;
+               }
+                       
+               if (this.top_ < 0) {
+                       this.top_ = 0;  
+               }                                                       
                        
-               w.style.left = x + "px";
-               w.style.top = y + "px";
+               w.style.left = this.left_ + "px";
+               w.style.top = this.top_ + "px";
+               
+               this.moving();
        },
        
        /**
+        * Called when window is being moved
+        */
+       moving: function() {
+       },
+
+       /**
         * Called when window is resizing.
         */
        resizing: function() {  
@@ -955,13 +966,13 @@ Wicket.Window.prototype = { 
                this.res = [0, 0];
 
                if (this.width < this.settings.minWidth) {
-                       this.left -= this.settings.minWidth - this.width;
+                       this.left_ -= this.settings.minWidth - this.width;
                        this.res[0] = this.settings.minWidth - this.width;
                        this.width = this.settings.minWidth;
                }
                
                if (this.height < this.settings.minHeight) {
-                       this.top -= this.settings.minHeight - this.height;
+                       this.top_ -= this.settings.minHeight - this.height;
                        this.res[1] = this.settings.minHeight - this.height;
                        this.height = this.settings.minHeight;
                }
@@ -988,6 +999,7 @@ Wicket.Window.prototype = { 
                w.style.width = this.width + "px";
                f.style.height = this.height + "px";
                
+               this.moving();
                this.resizing();
                
                return this.res;
@@ -999,14 +1011,17 @@ Wicket.Window.prototype = { 
                
                this.width = parseInt(w.style.width, 10) - deltaX;
                this.height = parseInt(f.style.height, 10) + deltaY;
-               this. left = parseInt(w.style.left, 10) + deltaX;
+               this.left_ = parseInt(w.style.left, 10) + deltaX;
                
                this.clipSize(true);
                
                w.style.width = this.width + "px";
-               w.style.left = this.left + "px";
+               w.style.left = this.left_ + "px";
                f.style.height = this.height  + "px";
                
+               this.moving();
+               this.resizing();
+               
                return this.res;
        },      
        
@@ -1027,13 +1042,14 @@ Wicket.Window.prototype = { 
                var w = this.window;
 
                this.width = parseInt(w.style.width, 10) - deltaX;
-               this.left = parseInt(w.style.left, 10) + deltaX;
+               this.left_ = parseInt(w.style.left, 10) + deltaX;
                
                this.clipSize(true);
                
                w.style.width = this.width + "px";
-               w.style.left = this.left + "px";
+               w.style.left = this.left_ + "px";
                
+               this.moving();
                this.resizing();
                
                return this.res;
@@ -1043,7 +1059,6 @@ Wicket.Window.prototype = { 
                var w = this.window;
                
                this.width = parseInt(w.style.width, 10) + deltaX;
-               
 
                this.clipSize();
                                                                                
        
@@ -1060,16 +1075,17 @@ Wicket.Window.prototype = { 
                
                this.width = parseInt(w.style.width, 10) - deltaX;
                this.height = parseInt(f.style.height, 10) - deltaY;
-               this.left = parseInt(w.style.left, 10) + deltaX;
-               this.top =  parseInt(w.style.top, 10) + deltaY;
+               this.left_ = parseInt(w.style.left, 10) + deltaX;
+               this.top_ =  parseInt(w.style.top, 10) + deltaY;
                
                this.clipSize(true, true);
                
                w.style.width = this.width + "px";
-               w.style.left = this.left + "px";
+               w.style.left = this.left_ + "px";
                f.style.height = this.height  + "px";
-               w.style.top = this.top + "px";
+               w.style.top = this.top_ + "px";
                
+               this.moving();
                this.resizing();
                                                                        
                return this.res;
@@ -1081,14 +1097,15 @@ Wicket.Window.prototype = { 
                
                this.width = parseInt(w.style.width, 10) + deltaX;
                this.height = parseInt(f.style.height, 10) - deltaY;
-               this.top = parseInt(w.style.top, 10) + deltaY;
+               this.top_ = parseInt(w.style.top, 10) + deltaY;
                
                this.clipSize(false, true);
                
                w.style.width = this.width + "px";
                f.style.height = this.height  + "px";
-               w.style.top = this.top + "px";
+               w.style.top = this.top_ + "px";
                
+               this.moving();
                this.resizing();
                                                
                return this.res;
@@ -1099,13 +1116,14 @@ Wicket.Window.prototype = { 
                var w = this.window;
                
                this.height = parseInt(f.style.height, 10) - deltaY;
-               this.top = parseInt(w.style.top, 10) + deltaY;
+               this.top_ = parseInt(w.style.top, 10) + deltaY;
                
                this.clipSize(false, true);
                
                f.style.height = this.height  + "px";
-               w.style.top = this.top + "px";
+               w.style.top = this.top_ + "px";
                
+               this.moving();
                this.resizing();
                                                
                return this.res;


Reply via email to