Fix issue with the dragging of widgets pushing off to the right funny with larger margin sizes. The margin was not being taken into account for the new position properly. This meant that if you were in column 10 and the margin was set to 20px the previous calculation was off by 200 pixels. New calculation for the placeholder position and the drag stop position takes the margin for the sizes multiplied by the column we want to determine how far to offset left.

This commit is contained in:
Christopher Heath
2015-08-05 16:43:39 -05:00
parent a1d77eb9bd
commit f9b579aac9
+10 -2
View File
@@ -1490,9 +1490,13 @@
if (this.$player === null) {
return false;
}
var margin_sides = this.options.widget_margins[0];
var placeholder_column = this.$preview_holder.attr('data-col');
var abs_offset = {
left: ui.position.left + this.baseX,
left: ui.position.left + this.baseX - (margin_sides * placeholder_column),
top: ui.position.top + this.baseY
};
@@ -1540,8 +1544,12 @@
fn.on_stop_drag = function (event, ui) {
this.$helper.add(this.$player).add(this.$wrapper)
.removeClass('dragging');
var margin_sides = this.options.widget_margins[0];
ui.position.left = ui.position.left + this.baseX;
var placeholder_column = this.$preview_holder.attr('data-col');
ui.position.left = ui.position.left + this.baseX - (margin_sides * placeholder_column);
ui.position.top = ui.position.top + this.baseY;
this.colliders_data = this.collision_api.get_closest_colliders(
ui.position);