attach placeholder just when it needed
This commit is contained in:
parent
de951e92c6
commit
b6fec29756
4 changed files with 6 additions and 4 deletions
3
dist/gridstack.js
vendored
3
dist/gridstack.js
vendored
|
|
@ -445,7 +445,6 @@
|
|||
this.set_animation(this.opts.animate);
|
||||
|
||||
this.placeholder = $('<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '"><div class="placeholder-content" /></div>').hide();
|
||||
this.container.append(this.placeholder);
|
||||
this.container.height((this.grid.get_grid_height()) * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
|
||||
|
||||
var on_resize_handler = function () {
|
||||
|
|
@ -579,6 +578,7 @@
|
|||
var cell_width, cell_height;
|
||||
|
||||
var on_start_moving = function (event, ui) {
|
||||
self.container.append(self.placeholder);
|
||||
var o = $(this);
|
||||
self.grid.clean_nodes();
|
||||
self.grid.begin_update(node);
|
||||
|
|
@ -597,6 +597,7 @@
|
|||
};
|
||||
|
||||
var on_end_moving = function (event, ui) {
|
||||
self.placeholder.detach();
|
||||
var o = $(this);
|
||||
node.el = o;
|
||||
self.placeholder.hide();
|
||||
|
|
|
|||
2
dist/gridstack.min.js
vendored
2
dist/gridstack.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/gridstack.min.map
vendored
2
dist/gridstack.min.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -445,7 +445,6 @@
|
|||
this.set_animation(this.opts.animate);
|
||||
|
||||
this.placeholder = $('<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '"><div class="placeholder-content" /></div>').hide();
|
||||
this.container.append(this.placeholder);
|
||||
this.container.height((this.grid.get_grid_height()) * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
|
||||
|
||||
var on_resize_handler = function () {
|
||||
|
|
@ -579,6 +578,7 @@
|
|||
var cell_width, cell_height;
|
||||
|
||||
var on_start_moving = function (event, ui) {
|
||||
self.container.append(self.placeholder);
|
||||
var o = $(this);
|
||||
self.grid.clean_nodes();
|
||||
self.grid.begin_update(node);
|
||||
|
|
@ -597,6 +597,7 @@
|
|||
};
|
||||
|
||||
var on_end_moving = function (event, ui) {
|
||||
self.placeholder.detach();
|
||||
var o = $(this);
|
||||
node.el = o;
|
||||
self.placeholder.hide();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue