@@ -99,7 +99,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
99
99
100
100
_create : function ( ) {
101
101
102
- var n , i , handle , axis , hname ,
102
+ var n , i , handle , axis , hname , margins ,
103
103
that = this ,
104
104
o = this . options ;
105
105
this . _addClass ( "ui-resizable" ) ;
@@ -131,18 +131,15 @@ $.widget( "ui.resizable", $.ui.mouse, {
131
131
132
132
this . elementIsWrapper = true ;
133
133
134
- this . element . css ( {
135
- marginLeft : this . originalElement . css ( "marginLeft" ) ,
134
+ margins = {
136
135
marginTop : this . originalElement . css ( "marginTop" ) ,
137
136
marginRight : this . originalElement . css ( "marginRight" ) ,
138
- marginBottom : this . originalElement . css ( "marginBottom" )
139
- } ) ;
140
- this . originalElement . css ( {
141
- marginLeft : 0 ,
142
- marginTop : 0 ,
143
- marginRight : 0 ,
144
- marginBottom : 0
145
- } ) ;
137
+ marginBottom : this . originalElement . css ( "marginBottom" ) ,
138
+ marginLeft : this . originalElement . css ( "marginLeft" )
139
+ } ;
140
+
141
+ this . element . css ( margins ) ;
142
+ this . originalElement . css ( "margin" , 0 ) ;
146
143
147
144
// support: Safari
148
145
// Prevent Safari textarea resize
@@ -157,7 +154,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
157
154
158
155
// Support: IE9
159
156
// avoid IE jump (hard set the margin)
160
- this . originalElement . css ( { margin : this . originalElement . css ( "margin" ) } ) ;
157
+ this . originalElement . css ( margins ) ;
161
158
162
159
this . _proportionallyResize ( ) ;
163
160
}
0 commit comments