attach placeholder just when it needed

This commit is contained in:
Pavel Reznikov 2015-06-18 19:30:48 -07:00
commit b6fec29756
4 changed files with 6 additions and 4 deletions

3
dist/gridstack.js vendored
View file

@ -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();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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();