Skip to content

Commit dfc6491

Browse files
committedAug 23, 2015
fix: Apply fix from #22 to vertical positioning
1 parent fb5b174 commit dfc6491

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed
 

‎src/jquery.gridster.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@
460460
}
461461

462462
this.options.show_element.call(this, $w, callback);
463-
463+
464464
return $w;
465465
};
466466

@@ -992,7 +992,7 @@
992992
$nexts.not(exclude).each($.proxy(function(i, widget) {
993993
this.move_widget_up( $(widget), size_y );
994994
}, this));
995-
995+
996996
this.set_dom_grid_height();
997997

998998
return this;
@@ -1490,14 +1490,15 @@
14901490
if (this.$player === null) {
14911491
return false;
14921492
}
1493-
1494-
var margin_sides = this.options.widget_margins[0];
1493+
1494+
var margin_sides = this.options.widget_margins;
14951495

14961496
var placeholder_column = this.$preview_holder.attr('data-col');
1497+
var placeholder_row = this.$preview_holder.attr('data-row');
14971498

14981499
var abs_offset = {
1499-
left: ui.position.left + this.baseX - (margin_sides * placeholder_column),
1500-
top: ui.position.top + this.baseY
1500+
left: ui.position.left + this.baseX - (margin_sides[0] * placeholder_column),
1501+
top: ui.position.top + this.baseY - (margin_sides[1] * placeholder_row)
15011502
};
15021503

15031504
// auto grow cols
@@ -1544,13 +1545,14 @@
15441545
fn.on_stop_drag = function (event, ui) {
15451546
this.$helper.add(this.$player).add(this.$wrapper)
15461547
.removeClass('dragging');
1547-
1548-
var margin_sides = this.options.widget_margins[0];
1548+
1549+
var margin_sides = this.options.widget_margins;
15491550

15501551
var placeholder_column = this.$preview_holder.attr('data-col');
1552+
var placeholder_row = this.$preview_holder.attr('data-row');
15511553

1552-
ui.position.left = ui.position.left + this.baseX - (margin_sides * placeholder_column);
1553-
ui.position.top = ui.position.top + this.baseY;
1554+
ui.position.left = ui.position.left + this.baseX - (margin_sides[0] * placeholder_column);
1555+
ui.position.top = ui.position.top + this.baseY - (margin_sides[1] * placeholder_row);
15541556
this.colliders_data = this.collision_api.get_closest_colliders(
15551557
ui.position);
15561558

0 commit comments

Comments
 (0)