Permalink
Browse files

Resizable: Don't use CSS shorthand properties with `.css()`

Fixes #7766
Closes gh-1644
  • Loading branch information...
scottgonzalez committed Nov 5, 2015
1 parent 1121655 commit 6a681c2c13afb6e76a6881b9dae928b9ff66a395
Showing with 9 additions and 12 deletions.
  1. +9 −12 ui/widgets/resizable.js
View
@@ -99,7 +99,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
_create: function() {
- var n, i, handle, axis, hname,
+ var n, i, handle, axis, hname, margins,
that = this,
o = this.options;
this._addClass( "ui-resizable" );
@@ -131,18 +131,15 @@ $.widget( "ui.resizable", $.ui.mouse, {
this.elementIsWrapper = true;
- this.element.css( {
- marginLeft: this.originalElement.css( "marginLeft" ),
+ margins = {
marginTop: this.originalElement.css( "marginTop" ),
marginRight: this.originalElement.css( "marginRight" ),
- marginBottom: this.originalElement.css( "marginBottom" )
- } );
- this.originalElement.css( {
- marginLeft: 0,
- marginTop: 0,
- marginRight: 0,
- marginBottom: 0
- } );
+ marginBottom: this.originalElement.css( "marginBottom" ),
+ marginLeft: this.originalElement.css( "marginLeft" )
+ };
+
+ this.element.css( margins );
+ this.originalElement.css( "margin", 0 );
// support: Safari
// Prevent Safari textarea resize
@@ -157,7 +154,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
// Support: IE9
// avoid IE jump (hard set the margin)
- this.originalElement.css( { margin: this.originalElement.css( "margin" ) } );
+ this.originalElement.css( margins );
this._proportionallyResize();
}

0 comments on commit 6a681c2

Please sign in to comment.