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