|
702 | 702 |
|
703 | 703 | el |
704 | 704 | .draggable(_.extend(this.opts.draggable, { |
705 | | - containment: this.opts.is_nested ? this.container.parent() : null |
| 705 | + containment: this.opts.is_nested ? this.container.parent() : null, |
| 706 | + start: on_start_moving, |
| 707 | + stop: on_end_moving, |
| 708 | + drag: drag_or_resize |
706 | 709 | })) |
707 | | - .on('dragstart', on_start_moving) |
708 | | - .on('dragstop', on_end_moving) |
709 | | - .on('drag', drag_or_resize) |
710 | | - .resizable(_.extend(this.opts.resizable, {})) |
711 | | - .on('resizestart', on_start_moving) |
712 | | - .on('resizestop', on_end_moving) |
713 | | - .on('resize', drag_or_resize); |
| 710 | + .resizable(_.extend(this.opts.resizable, { |
| 711 | + resizestart: on_start_moving, |
| 712 | + resizestop: on_end_moving, |
| 713 | + resize: drag_or_resize |
| 714 | + })); |
714 | 715 |
|
715 | 716 | if (node.no_move || this._is_one_column_mode()) { |
716 | 717 | el.draggable('disable'); |
|
1003 | 1004 |
|
1004 | 1005 | scope.GridStackUI.Utils = Utils; |
1005 | 1006 |
|
1006 | | - function event_stop_propagate(event) { |
1007 | | - event.stopPropagation(); |
1008 | | - } |
1009 | 1007 | $.fn.gridstack = function(opts) { |
1010 | 1008 | return this.each(function() { |
1011 | 1009 | var o = $(this); |
1012 | 1010 | if (!o.data('gridstack')) { |
1013 | 1011 | o |
1014 | | - .data('gridstack', new GridStack(this, opts)) |
1015 | | - .on('dragstart', event_stop_propagate) |
1016 | | - .on('dragstop', event_stop_propagate) |
1017 | | - .on('drag', event_stop_propagate) |
1018 | | - .on('resizestart', event_stop_propagate) |
1019 | | - .on('resizestop', event_stop_propagate) |
1020 | | - .on('resize', event_stop_propagate) |
1021 | | - .on('change', event_stop_propagate); |
| 1012 | + .data('gridstack', new GridStack(this, opts)); |
1022 | 1013 | } |
1023 | 1014 | }); |
1024 | 1015 | }; |
|
0 commit comments