X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FResizable.js;h=b0fb9f3b3f0435b26897c56cfb97d7d9820097a9;hb=75cbc4ce04c9c01ac47671cb01320ce699128d00;hp=4c6a1a0d61752d187596795dc4852c74faeeb635;hpb=40b88587461fe45d51a8c37dda3abf461310bfa0;p=roojs1 diff --git a/Roo/Resizable.js b/Roo/Resizable.js index 4c6a1a0d61..b0fb9f3b3f 100644 --- a/Roo/Resizable.js +++ b/Roo/Resizable.js @@ -28,6 +28,7 @@ Value Description 'sw' southwest 'se' southeast 'ne' northeast + 'hd' horizontal drag 'all' all *

Here's an example showing the creation of a typical Resizable:

@@ -176,6 +177,17 @@ Roo.Resizable = function(el, config) * @param {Roo.EventObject} e The mousedown event */ "beforeresize" : true, + /** + * @event resizing + * Fired a resizing. + * @param {Roo.Resizable} this + * @param {Number} x The new x position + * @param {Number} y The new y position + * @param {Number} w The new w width + * @param {Number} h The new h hight + * @param {Roo.EventObject} e The mouseup event + */ + "resizing" : true, /** * @event resize * Fired after a resize. @@ -308,6 +320,7 @@ Roo.extend(Roo.Resizable, Roo.util.Observable, { // private updateChildSize : function(){ + if(this.resizeChild){ var el = this.el; var child = this.resizeChild; @@ -333,7 +346,9 @@ Roo.extend(Roo.Resizable, Roo.util.Observable, { // private snap : function(value, inc, min){ - if(!inc || !value) return value; + if(!inc || !value) { + return value; + } var newValue = value; var m = value % inc; if(m > 0){ @@ -373,6 +388,7 @@ Roo.extend(Roo.Resizable, Roo.util.Observable, { // private onMouseMove : function(e){ + if(this.enabled){ try{// try catch so if something goes wrong the user doesn't get hung @@ -430,7 +446,7 @@ Roo.extend(Roo.Resizable, Roo.util.Observable, { diffX = (diffX > 0) ? diffX-sub : diffX+sub; } } - x += diffX + x += diffX; x = Math.max(this.minX, x); break; case "west": @@ -549,6 +565,7 @@ Roo.extend(Roo.Resizable, Roo.util.Observable, { } }catch(e){} } + this.fireEvent("resizing", this, x, y, w, h, e); }, // private @@ -580,7 +597,10 @@ Roo.extend(Roo.Resizable, Roo.util.Observable, { getResizeChild : function(){ return this.resizeChild; }, - + groupHandler : function() + { + + }, /** * Destroys this resizable. If the element was wrapped and * removeEl is not true then the element remains. @@ -647,6 +667,7 @@ Roo.Resizable.Handle = function(rz, pos, disableTrackOver, transparent){ // private Roo.Resizable.Handle.prototype = { afterResize : function(rz){ + Roo.log('after?'); // do nothing }, // private