mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fixes in drag/stop callbacks. Related to #23.
- break ondrag callback execution if stop event already was fired. - unset this.$player after the execution of draggable.stop callback.
This commit is contained in:
+10
-6
@@ -474,6 +474,11 @@
|
||||
* @param {Object} A prepared ui object.
|
||||
*/
|
||||
fn.on_drag = function(event, ui) {
|
||||
//break if dragstop has been fired
|
||||
if (this.$player === null) {
|
||||
return false;
|
||||
};
|
||||
|
||||
var abs_offset = {
|
||||
left: ui.position.left + this.baseX,
|
||||
top: ui.position.top + this.baseY
|
||||
@@ -548,15 +553,14 @@
|
||||
this.$player.coords().grid.row = this.placeholder_grid_data.row;
|
||||
this.$player.coords().grid.col = this.placeholder_grid_data.col;
|
||||
|
||||
this.$player = null;
|
||||
|
||||
this.$preview_holder.remove();
|
||||
|
||||
this.set_dom_grid_height();
|
||||
|
||||
if (this.options.draggable.stop) {
|
||||
this.options.draggable.stop.call(this, event, ui);
|
||||
}
|
||||
|
||||
this.$preview_holder.remove();
|
||||
this.$player = null;
|
||||
|
||||
this.set_dom_grid_height();
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user