Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b6fec29

Browse files
committed
attach placeholder just when it needed
1 parent de951e9 commit b6fec29

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

dist/gridstack.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@
445445
this.set_animation(this.opts.animate);
446446

447447
this.placeholder = $('<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '"><div class="placeholder-content" /></div>').hide();
448-
this.container.append(this.placeholder);
449448
this.container.height((this.grid.get_grid_height()) * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
450449

451450
var on_resize_handler = function () {
@@ -579,6 +578,7 @@
579578
var cell_width, cell_height;
580579

581580
var on_start_moving = function (event, ui) {
581+
self.container.append(self.placeholder);
582582
var o = $(this);
583583
self.grid.clean_nodes();
584584
self.grid.begin_update(node);
@@ -597,6 +597,7 @@
597597
};
598598

599599
var on_end_moving = function (event, ui) {
600+
self.placeholder.detach();
600601
var o = $(this);
601602
node.el = o;
602603
self.placeholder.hide();

dist/gridstack.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)