@@ -983,29 +983,15 @@ $.ui.plugin.add("resizable", "alsoResize", {
983
983
984
984
start : function ( ) {
985
985
var that = $ ( this ) . resizable ( "instance" ) ,
986
- o = that . options ,
987
- _store = function ( exp ) {
988
- $ ( exp ) . each ( function ( ) {
989
- var el = $ ( this ) ;
990
- el . data ( "ui-resizable-alsoresize" , {
991
- width : parseInt ( el . width ( ) , 10 ) , height : parseInt ( el . height ( ) , 10 ) ,
992
- left : parseInt ( el . css ( "left" ) , 10 ) , top : parseInt ( el . css ( "top" ) , 10 )
993
- } ) ;
994
- } ) ;
995
- } ;
986
+ o = that . options ;
996
987
997
- if ( typeof ( o . alsoResize ) === "object" && ! o . alsoResize . parentNode ) {
998
- if ( o . alsoResize . length ) {
999
- o . alsoResize = o . alsoResize [ 0 ] ;
1000
- _store ( o . alsoResize ) ;
1001
- } else {
1002
- $ . each ( o . alsoResize , function ( exp ) {
1003
- _store ( exp ) ;
1004
- } ) ;
1005
- }
1006
- } else {
1007
- _store ( o . alsoResize ) ;
1008
- }
988
+ $ ( o . alsoResize ) . each ( function ( ) {
989
+ var el = $ ( this ) ;
990
+ el . data ( "ui-resizable-alsoresize" , {
991
+ width : parseInt ( el . width ( ) , 10 ) , height : parseInt ( el . height ( ) , 10 ) ,
992
+ left : parseInt ( el . css ( "left" ) , 10 ) , top : parseInt ( el . css ( "top" ) , 10 )
993
+ } ) ;
994
+ } ) ;
1009
995
} ,
1010
996
1011
997
resize : function ( event , ui ) {
@@ -1018,35 +1004,23 @@ $.ui.plugin.add("resizable", "alsoResize", {
1018
1004
width : ( that . size . width - os . width ) || 0 ,
1019
1005
top : ( that . position . top - op . top ) || 0 ,
1020
1006
left : ( that . position . left - op . left ) || 0
1021
- } ,
1007
+ } ;
1008
+
1009
+ $ ( o . alsoResize ) . each ( function ( ) {
1010
+ var el = $ ( this ) , start = $ ( this ) . data ( "ui-resizable-alsoresize" ) , style = { } ,
1011
+ css = el . parents ( ui . originalElement [ 0 ] ) . length ?
1012
+ [ "width" , "height" ] :
1013
+ [ "width" , "height" , "top" , "left" ] ;
1022
1014
1023
- _alsoResize = function ( exp , c ) {
1024
- $ ( exp ) . each ( function ( ) {
1025
- var el = $ ( this ) , start = $ ( this ) . data ( "ui-resizable-alsoresize" ) , style = { } ,
1026
- css = c && c . length ?
1027
- c :
1028
- el . parents ( ui . originalElement [ 0 ] ) . length ?
1029
- [ "width" , "height" ] :
1030
- [ "width" , "height" , "top" , "left" ] ;
1031
-
1032
- $ . each ( css , function ( i , prop ) {
1033
- var sum = ( start [ prop ] || 0 ) + ( delta [ prop ] || 0 ) ;
1034
- if ( sum && sum >= 0 ) {
1035
- style [ prop ] = sum || null ;
1036
- }
1037
- } ) ;
1038
-
1039
- el . css ( style ) ;
1015
+ $ . each ( css , function ( i , prop ) {
1016
+ var sum = ( start [ prop ] || 0 ) + ( delta [ prop ] || 0 ) ;
1017
+ if ( sum && sum >= 0 ) {
1018
+ style [ prop ] = sum || null ;
1019
+ }
1040
1020
} ) ;
1041
- } ;
1042
1021
1043
- if ( typeof ( o . alsoResize ) === "object" && ! o . alsoResize . nodeType ) {
1044
- $ . each ( o . alsoResize , function ( exp , c ) {
1045
- _alsoResize ( exp , c ) ;
1022
+ el . css ( style ) ;
1046
1023
} ) ;
1047
- } else {
1048
- _alsoResize ( o . alsoResize ) ;
1049
- }
1050
1024
} ,
1051
1025
1052
1026
stop : function ( ) {
0 commit comments