Include resizable, draggable opts in all listeners for resizable, draggable, respectively. Fixes issue particularly when passing handle to draggable - was listening to everything on el rather than this.opts.draggable.handle.
This commit is contained in:
parent
96b84ed45b
commit
8b1f180135
|
@ -702,15 +702,16 @@
|
|||
|
||||
el
|
||||
.draggable(_.extend(this.opts.draggable, {
|
||||
containment: this.opts.is_nested ? this.container.parent() : null
|
||||
containment: this.opts.is_nested ? this.container.parent() : null,
|
||||
start: on_start_moving,
|
||||
stop: on_end_moving,
|
||||
drag: drag_or_resize
|
||||
}))
|
||||
.on('dragstart', on_start_moving)
|
||||
.on('dragstop', on_end_moving)
|
||||
.on('drag', drag_or_resize)
|
||||
.resizable(_.extend(this.opts.resizable, {}))
|
||||
.on('resizestart', on_start_moving)
|
||||
.on('resizestop', on_end_moving)
|
||||
.on('resize', drag_or_resize);
|
||||
.resizable(_.extend(this.opts.resizable, {
|
||||
resizestart: on_start_moving,
|
||||
resizestop: on_end_moving,
|
||||
resize: drag_or_resize
|
||||
}));
|
||||
|
||||
if (node.no_move || this._is_one_column_mode()) {
|
||||
el.draggable('disable');
|
||||
|
@ -1003,22 +1004,12 @@
|
|||
|
||||
scope.GridStackUI.Utils = Utils;
|
||||
|
||||
function event_stop_propagate(event) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
$.fn.gridstack = function(opts) {
|
||||
return this.each(function() {
|
||||
var o = $(this);
|
||||
if (!o.data('gridstack')) {
|
||||
o
|
||||
.data('gridstack', new GridStack(this, opts))
|
||||
.on('dragstart', event_stop_propagate)
|
||||
.on('dragstop', event_stop_propagate)
|
||||
.on('drag', event_stop_propagate)
|
||||
.on('resizestart', event_stop_propagate)
|
||||
.on('resizestop', event_stop_propagate)
|
||||
.on('resize', event_stop_propagate)
|
||||
.on('change', event_stop_propagate);
|
||||
.data('gridstack', new GridStack(this, opts));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue