Skip to content

Commit 7eb0f76

Browse files
committed
[fixup]: Clean up from gh-1324
1 parent adf427a commit 7eb0f76

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

tests/unit/resizable/resizable_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ test( "alsoResize + multiple selection", function() {
449449
})
450450
.appendTo( "body"),
451451
element = $( "#resizable1" ).resizable({
452-
alsoResize: $.merge(other1, other2),
452+
alsoResize: other1.add( other2 ),
453453
containment: "#container"
454454
});
455455

ui/resizable.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -991,17 +991,15 @@ $.ui.plugin.add("resizable", "alsoResize", {
991991

992992
start: function() {
993993
var that = $(this).resizable( "instance" ),
994-
o = that.options,
995-
_store = function(exp) {
996-
$(exp).each(function() {
994+
o = that.options;
995+
996+
$(o.alsoResize).each(function() {
997997
var el = $(this);
998998
el.data("ui-resizable-alsoresize", {
999999
width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
10001000
left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
10011001
});
10021002
});
1003-
};
1004-
_store(o.alsoResize);
10051003
},
10061004

10071005
resize: function(event, ui) {
@@ -1014,14 +1012,11 @@ $.ui.plugin.add("resizable", "alsoResize", {
10141012
width: (that.size.width - os.width) || 0,
10151013
top: (that.position.top - op.top) || 0,
10161014
left: (that.position.left - op.left) || 0
1017-
},
1015+
};
10181016

1019-
_alsoResize = function(exp, c) {
1020-
$(exp).each(function() {
1017+
$(o.alsoResize).each(function() {
10211018
var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
1022-
css = c && c.length ?
1023-
c :
1024-
el.parents(ui.originalElement[0]).length ?
1019+
css = el.parents(ui.originalElement[0]).length ?
10251020
[ "width", "height" ] :
10261021
[ "width", "height", "top", "left" ];
10271022

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

10351030
el.css(style);
10361031
});
1037-
};
1038-
_alsoResize(o.alsoResize);
10391032
},
10401033

10411034
stop: function() {

0 commit comments

Comments
 (0)