Skip to content

Commit

Permalink
[fixup]: Clean up from gh-1324
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgonzalez committed Mar 3, 2015
1 parent adf427a commit 7eb0f76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/unit/resizable/resizable_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ test( "alsoResize + multiple selection", function() {
})
.appendTo( "body"),
element = $( "#resizable1" ).resizable({
alsoResize: $.merge(other1, other2),
alsoResize: other1.add( other2 ),
containment: "#container"
});

Expand Down
19 changes: 6 additions & 13 deletions ui/resizable.js
Original file line number Diff line number Diff line change
Expand Up @@ -991,17 +991,15 @@ $.ui.plugin.add("resizable", "alsoResize", {

start: function() {
var that = $(this).resizable( "instance" ),
o = that.options,
_store = function(exp) {
$(exp).each(function() {
o = that.options;

$(o.alsoResize).each(function() {
var el = $(this);
el.data("ui-resizable-alsoresize", {
width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
});
});
};
_store(o.alsoResize);
},

resize: function(event, ui) {
Expand All @@ -1014,14 +1012,11 @@ $.ui.plugin.add("resizable", "alsoResize", {
width: (that.size.width - os.width) || 0,
top: (that.position.top - op.top) || 0,
left: (that.position.left - op.left) || 0
},
};

_alsoResize = function(exp, c) {
$(exp).each(function() {
$(o.alsoResize).each(function() {
var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
css = c && c.length ?
c :
el.parents(ui.originalElement[0]).length ?
css = el.parents(ui.originalElement[0]).length ?
[ "width", "height" ] :
[ "width", "height", "top", "left" ];

Expand All @@ -1034,8 +1029,6 @@ $.ui.plugin.add("resizable", "alsoResize", {

el.css(style);
});
};
_alsoResize(o.alsoResize);
},

stop: function() {
Expand Down

0 comments on commit 7eb0f76

Please sign in to comment.