Skip to content

Commit 6a681c2

Browse files
committed
Resizable: Don't use CSS shorthand properties with .css()
Fixes #7766 Closes jquerygh-1644
1 parent 1121655 commit 6a681c2

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

ui/widgets/resizable.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
9999

100100
_create: function() {
101101

102-
var n, i, handle, axis, hname,
102+
var n, i, handle, axis, hname, margins,
103103
that = this,
104104
o = this.options;
105105
this._addClass( "ui-resizable" );
@@ -131,18 +131,15 @@ $.widget( "ui.resizable", $.ui.mouse, {
131131

132132
this.elementIsWrapper = true;
133133

134-
this.element.css( {
135-
marginLeft: this.originalElement.css( "marginLeft" ),
134+
margins = {
136135
marginTop: this.originalElement.css( "marginTop" ),
137136
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 );
146143

147144
// support: Safari
148145
// Prevent Safari textarea resize
@@ -157,7 +154,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
157154

158155
// Support: IE9
159156
// avoid IE jump (hard set the margin)
160-
this.originalElement.css( { margin: this.originalElement.css( "margin" ) } );
157+
this.originalElement.css( margins );
161158

162159
this._proportionallyResize();
163160
}

0 commit comments

Comments
 (0)