'sw' southwest
'se' southeast
'ne' northeast
+ 'hd' horizontal drag
'all' all
</pre>
* <p>Here's an example showing the creation of a typical Resizable:</p>
* @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.
// private
updateChildSize : function(){
+
if(this.resizeChild){
var el = this.el;
var child = this.resizeChild;
// 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){
// private
onMouseMove : function(e){
+
if(this.enabled){
try{// try catch so if something goes wrong the user doesn't get hung
h -= diffY;
break;
case "hdrag":
+
+ if (wi) {
+ var adiffX = Math.abs(diffX);
+ var sub = (adiffX % wi); // how much
+ if (sub > (wi/2)) { // far enough to snap
+ diffX = (diffX > 0) ? diffX-sub + wi : diffX+sub - wi;
+ } else {
+ // remove difference..
+ diffX = (diffX > 0) ? diffX-sub : diffX+sub;
+ }
+ }
x += diffX;
x = Math.max(this.minX, x);
- w -= diffX;
break;
case "west":
diffX = this.constrain(w, diffX, mw, mxw);
case "southwest":
x -= sw - w;
break;
- case "hdrag":
case "west":
x -= sw - w;
break;
}
}catch(e){}
}
+ this.fireEvent("resizing", this, x, y, w, h, e);
},
// private
getResizeChild : function(){
return this.resizeChild;
},
-
+ groupHandler : function()
+ {
+
+ },
/**
* Destroys this resizable. If the element was wrapped and
* removeEl is not true then the element remains.
// private
Roo.Resizable.Handle.prototype = {
afterResize : function(rz){
+ Roo.log('after?');
// do nothing
},
// private