aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-11-05 09:19:55 -0500
committerScott González <scott.gonzalez@gmail.com>2015-11-05 11:44:09 -0500
commit6a681c2c13afb6e76a6881b9dae928b9ff66a395 (patch)
treeea757a4a0eb1a0b256ff48d7d348bdce58e7a645 /ui
parent11216554febdcde22007e38624e9336539020abc (diff)
downloadjquery-ui-6a681c2c13afb6e76a6881b9dae928b9ff66a395.tar.gz
jquery-ui-6a681c2c13afb6e76a6881b9dae928b9ff66a395.zip
Resizable: Don't use CSS shorthand properties with `.css()`
Fixes #7766 Closes gh-1644
Diffstat (limited to 'ui')
-rw-r--r--ui/widgets/resizable.js21
1 files changed, 9 insertions, 12 deletions
diff --git a/ui/widgets/resizable.js b/ui/widgets/resizable.js
index 05ad72099..da704de4b 100644
--- a/ui/widgets/resizable.js
+++ b/ui/widgets/resizable.js
@@ -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();
}