@@ -35,6 +35,7 @@ $.widget("ui.resizable", $.ui.mouse, {
35
35
animateEasing : "swing" ,
36
36
aspectRatio : false ,
37
37
autoHide : false ,
38
+ classes : { } ,
38
39
containment : false ,
39
40
ghost : false ,
40
41
grid : false ,
@@ -88,7 +89,7 @@ $.widget("ui.resizable", $.ui.mouse, {
88
89
var n , i , handle , axis , hname ,
89
90
that = this ,
90
91
o = this . options ;
91
- this . element . addClass ( "ui-resizable" ) ;
92
+ this . _addClass ( "ui-resizable" ) ;
92
93
93
94
$ . extend ( this , {
94
95
_aspectRatio : ! ! ( o . aspectRatio ) ,
@@ -173,13 +174,14 @@ $.widget("ui.resizable", $.ui.mouse, {
173
174
174
175
handle = $ . trim ( n [ i ] ) ;
175
176
hname = "ui-resizable-" + handle ;
176
- axis = $ ( "<div class='ui-resizable-handle " + hname + "'></div>" ) ;
177
+ axis = $ ( "<div>" ) ;
178
+ this . _addClass ( axis , "ui-resizable-handle " + hname ) ;
177
179
178
180
axis . css ( { zIndex : o . zIndex } ) ;
179
181
180
182
// TODO : What's going on here?
181
183
if ( "se" === handle ) {
182
- axis . addClass ( "ui-icon ui-icon-gripsmall-diagonal-se" ) ;
184
+ this . _addClass ( axis , null , "ui-icon ui-icon-gripsmall-diagonal-se" ) ;
183
185
}
184
186
185
187
this . handles [ handle ] = ".ui-resizable-" + handle ;
@@ -241,21 +243,21 @@ $.widget("ui.resizable", $.ui.mouse, {
241
243
242
244
if ( o . autoHide ) {
243
245
this . _handles . hide ( ) ;
246
+ this . _addClass ( "ui-resizable-autohide" ) ;
244
247
$ ( this . element )
245
- . addClass ( "ui-resizable-autohide" )
246
248
. mouseenter ( function ( ) {
247
249
if ( o . disabled ) {
248
250
return ;
249
251
}
250
- $ ( this ) . removeClass ( "ui-resizable-autohide" ) ;
252
+ that . _removeClass ( $ ( this ) , "ui-resizable-autohide" ) ;
251
253
that . _handles . show ( ) ;
252
254
} )
253
255
. mouseleave ( function ( ) {
254
256
if ( o . disabled ) {
255
257
return ;
256
258
}
257
259
if ( ! that . resizing ) {
258
- $ ( this ) . addClass ( "ui-resizable-autohide" ) ;
260
+ that . _addClass ( $ ( this ) , "ui-resizable-autohide" ) ;
259
261
that . _handles . hide ( ) ;
260
262
}
261
263
} ) ;
@@ -272,7 +274,6 @@ $.widget("ui.resizable", $.ui.mouse, {
272
274
var wrapper ,
273
275
_destroy = function ( exp ) {
274
276
$ ( exp )
275
- . removeClass ( "ui-resizable ui-resizable-disabled ui-resizable-resizing" )
276
277
. removeData ( "resizable" )
277
278
. removeData ( "ui-resizable" )
278
279
. unbind ( ".resizable" )
@@ -366,7 +367,7 @@ $.widget("ui.resizable", $.ui.mouse, {
366
367
cursor = $ ( ".ui-resizable-" + this . axis ) . css ( "cursor" ) ;
367
368
$ ( "body" ) . css ( "cursor" , cursor === "auto" ? this . axis + "-resize" : cursor ) ;
368
369
369
- el . addClass ( "ui-resizable-resizing" ) ;
370
+ this . _addClass ( "ui-resizable-resizing" ) ;
370
371
this . _propagate ( "start" , event ) ;
371
372
return true ;
372
373
} ,
@@ -450,7 +451,7 @@ $.widget("ui.resizable", $.ui.mouse, {
450
451
451
452
$ ( "body" ) . css ( "cursor" , "auto" ) ;
452
453
453
- this . element . removeClass ( "ui-resizable-resizing" ) ;
454
+ this . _removeClass ( "ui-resizable-resizing" ) ;
454
455
455
456
this . _propagate ( "stop" , event ) ;
456
457
@@ -679,7 +680,8 @@ $.widget("ui.resizable", $.ui.mouse, {
679
680
680
681
this . helper = this . helper || $ ( "<div style='overflow:hidden;'></div>" ) ;
681
682
682
- this . helper . addClass ( this . _helper ) . css ( {
683
+ this . _addClass ( this . helper , this . _helper ) ;
684
+ this . helper . css ( {
683
685
width : this . element . outerWidth ( ) - 1 ,
684
686
height : this . element . outerHeight ( ) - 1 ,
685
687
position : "absolute" ,
@@ -1072,9 +1074,9 @@ $.ui.plugin.add("resizable", "ghost", {
1072
1074
margin : 0 ,
1073
1075
left : 0 ,
1074
1076
top : 0
1075
- } )
1076
- . addClass ( "ui-resizable-ghost" )
1077
- . addClass ( typeof o . ghost === "string" ? o . ghost : "" ) ;
1077
+ } ) ;
1078
+ this . _addClass ( that . ghost , "ui-resizable-ghost" ,
1079
+ typeof o . ghost === "string" ? o . ghost : "" ) ;
1078
1080
1079
1081
that . ghost . appendTo ( that . helper ) ;
1080
1082
0 commit comments