@@ -321,22 +321,14 @@ $.widget("ui.resizable", $.ui.mouse, {
321
321
322
322
_mouseDrag : function ( event ) {
323
323
324
- var data ,
325
- el = this . helper , props = { } ,
324
+ var data , props ,
326
325
smp = this . originalMousePosition ,
327
326
a = this . axis ,
328
327
dx = ( event . pageX - smp . left ) || 0 ,
329
328
dy = ( event . pageY - smp . top ) || 0 ,
330
329
trigger = this . _change [ a ] ;
331
330
332
- this . prevPosition = {
333
- top : this . position . top ,
334
- left : this . position . left
335
- } ;
336
- this . prevSize = {
337
- width : this . size . width ,
338
- height : this . size . height
339
- } ;
331
+ this . _updatePrevProperties ( ) ;
340
332
341
333
if ( ! trigger ) {
342
334
return false ;
@@ -355,26 +347,16 @@ $.widget("ui.resizable", $.ui.mouse, {
355
347
356
348
this . _propagate ( "resize" , event ) ;
357
349
358
- if ( this . position . top !== this . prevPosition . top ) {
359
- props . top = this . position . top + "px" ;
360
- }
361
- if ( this . position . left !== this . prevPosition . left ) {
362
- props . left = this . position . left + "px" ;
363
- }
364
- if ( this . size . width !== this . prevSize . width ) {
365
- props . width = this . size . width + "px" ;
366
- }
367
- if ( this . size . height !== this . prevSize . height ) {
368
- props . height = this . size . height + "px" ;
369
- }
370
- el . css ( props ) ;
350
+ props = this . _applyChanges ( ) ;
371
351
372
352
if ( ! this . _helper && this . _proportionallyResizeElements . length ) {
373
353
this . _proportionallyResize ( ) ;
374
354
}
375
355
376
356
if ( ! $ . isEmptyObject ( props ) ) {
357
+ this . _updatePrevProperties ( ) ;
377
358
this . _trigger ( "resize" , event , this . ui ( ) ) ;
359
+ this . _applyChanges ( ) ;
378
360
}
379
361
380
362
return false ;
@@ -423,6 +405,38 @@ $.widget("ui.resizable", $.ui.mouse, {
423
405
424
406
} ,
425
407
408
+ _updatePrevProperties : function ( ) {
409
+ this . prevPosition = {
410
+ top : this . position . top ,
411
+ left : this . position . left
412
+ } ;
413
+ this . prevSize = {
414
+ width : this . size . width ,
415
+ height : this . size . height
416
+ } ;
417
+ } ,
418
+
419
+ _applyChanges : function ( ) {
420
+ var props = { } ;
421
+
422
+ if ( this . position . top !== this . prevPosition . top ) {
423
+ props . top = this . position . top + "px" ;
424
+ }
425
+ if ( this . position . left !== this . prevPosition . left ) {
426
+ props . left = this . position . left + "px" ;
427
+ }
428
+ if ( this . size . width !== this . prevSize . width ) {
429
+ props . width = this . size . width + "px" ;
430
+ }
431
+ if ( this . size . height !== this . prevSize . height ) {
432
+ props . height = this . size . height + "px" ;
433
+ }
434
+
435
+ this . helper . css ( props ) ;
436
+
437
+ return props ;
438
+ } ,
439
+
426
440
_updateVirtualBoundaries : function ( forceAspectRatio ) {
427
441
var pMinWidth , pMaxWidth , pMinHeight , pMaxHeight , b ,
428
442
o = this . options ;
0 commit comments