animateEasing: "swing",
aspectRatio: false,
autoHide: false,
+ classes: {
+ "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
+ },
containment: false,
ghost: false,
grid: false,
var n, i, handle, axis, hname,
that = this,
o = this.options;
- this.element.addClass("ui-resizable");
+ this._addClass( "ui-resizable" );
$.extend(this, {
_aspectRatio: !!(o.aspectRatio),
handle = $.trim(n[i]);
hname = "ui-resizable-" + handle;
- axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
+ axis = $("<div>");
+ this._addClass( axis, "ui-resizable-handle " + hname );
axis.css({ zIndex: o.zIndex });
- // TODO : What's going on here?
- if ("se" === handle) {
- axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
- }
-
this.handles[handle] = ".ui-resizable-" + handle;
this.element.append(axis);
}
if (o.autoHide) {
this._handles.hide();
+ this._addClass( "ui-resizable-autohide" );
$(this.element)
- .addClass("ui-resizable-autohide")
.mouseenter(function() {
if (o.disabled) {
return;
}
- $(this).removeClass("ui-resizable-autohide");
+ that._removeClass( "ui-resizable-autohide" );
that._handles.show();
})
.mouseleave(function() {
return;
}
if (!that.resizing) {
- $(this).addClass("ui-resizable-autohide");
+ that._addClass( "ui-resizable-autohide" );
that._handles.hide();
}
});
var wrapper,
_destroy = function(exp) {
$(exp)
- .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
.removeData("resizable")
.removeData("ui-resizable")
.unbind(".resizable")
cursor = $(".ui-resizable-" + this.axis).css("cursor");
$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
- el.addClass("ui-resizable-resizing");
+ this._addClass( "ui-resizable-resizing" );
this._propagate("start", event);
return true;
},
$("body").css("cursor", "auto");
- this.element.removeClass("ui-resizable-resizing");
+ this._removeClass( "ui-resizable-resizing" );
this._propagate("stop", event);
this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
- this.helper.addClass(this._helper).css({
+ this._addClass( this.helper, this._helper );
+ this.helper.css({
width: this.element.outerWidth() - 1,
height: this.element.outerHeight() - 1,
position: "absolute",
start: function() {
- var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
+ var that = $(this).resizable( "instance" ), cs = that.size;
that.ghost = that.originalElement.clone();
- that.ghost
- .css({
- opacity: 0.25,
- display: "block",
- position: "relative",
- height: cs.height,
- width: cs.width,
- margin: 0,
- left: 0,
- top: 0
- })
- .addClass("ui-resizable-ghost")
- .addClass(typeof o.ghost === "string" ? o.ghost : "");
+ that.ghost.css({
+ opacity: 0.25,
+ display: "block",
+ position: "relative",
+ height: cs.height,
+ width: cs.width,
+ margin: 0,
+ left: 0,
+ top: 0
+ });
+
+ that._addClass( that.ghost, "ui-resizable-ghost" );
+
+ // DEPRECATED
+ // TODO: remove after 1.12
+ if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) {
+
+ // Ghost option
+ that.ghost.addClass( this.options.ghost );
+ }
that.ghost.appendTo(that.helper);