1
- // jqueryui- gridstack-dragdrop-plugin .ts 2.0.0-rc @preserve
1
+ // gridstack-dd-jqueryui .ts 2.0.0-rc @preserve
2
2
3
3
/** JQuery UI Drag&Drop plugin
4
4
* https://gridstackjs.com/
7
7
*/
8
8
9
9
import { GridStack , GridStackElement } from '../gridstack' ;
10
- import { GridStackDragDropPlugin , DDOpts , DDKey , DDDropOpt , DDCallback , DDValue } from '../gridstack-dragdrop-plugin ' ;
10
+ import { GridStackDD , DDOpts , DDKey , DDDropOpt , DDCallback , DDValue } from '../gridstack-dd ' ;
11
11
import { GridItemHTMLElement , DDDragInOpt } from '../types' ;
12
12
13
13
// TODO: TEMPORARY until can remove jquery-ui drag&drop and this class and use HTML5 instead !
@@ -18,12 +18,12 @@ import './jquery-ui.js';
18
18
/**
19
19
* Jquery-ui based drag'n'drop plugin.
20
20
*/
21
- export class JQueryUIGridStackDragDropPlugin extends GridStackDragDropPlugin {
21
+ export class GridStackDDJQueryUI extends GridStackDD {
22
22
public constructor ( grid : GridStack ) {
23
23
super ( grid ) ;
24
24
}
25
25
26
- public resizable ( el : GridItemHTMLElement , opts : DDOpts , key ?: DDKey , value ?: DDValue ) : GridStackDragDropPlugin {
26
+ public resizable ( el : GridItemHTMLElement , opts : DDOpts , key ?: DDKey , value ?: DDValue ) : GridStackDD {
27
27
let $el : JQuery = $ ( el ) ;
28
28
if ( opts === 'disable' || opts === 'enable' ) {
29
29
$el . resizable ( opts ) ;
@@ -44,7 +44,7 @@ export class JQueryUIGridStackDragDropPlugin extends GridStackDragDropPlugin {
44
44
return this ;
45
45
}
46
46
47
- public draggable ( el : GridItemHTMLElement , opts : DDOpts , key ?: DDKey , value ?: DDValue ) : GridStackDragDropPlugin {
47
+ public draggable ( el : GridItemHTMLElement , opts : DDOpts , key ?: DDKey , value ?: DDValue ) : GridStackDD {
48
48
let $el : JQuery = $ ( el ) ;
49
49
if ( opts === 'disable' || opts === 'enable' ) {
50
50
$el . draggable ( opts ) ;
@@ -66,13 +66,13 @@ export class JQueryUIGridStackDragDropPlugin extends GridStackDragDropPlugin {
66
66
return this ;
67
67
}
68
68
69
- public dragIn ( el : GridStackElement , opts : DDDragInOpt ) : GridStackDragDropPlugin {
69
+ public dragIn ( el : GridStackElement , opts : DDDragInOpt ) : GridStackDD {
70
70
let $el : JQuery = $ ( el ) ;
71
71
$el . draggable ( opts ) ;
72
72
return this ;
73
73
}
74
74
75
- public droppable ( el : GridItemHTMLElement , opts : DDOpts | DDDropOpt , key ?: DDKey , value ?: DDValue ) : GridStackDragDropPlugin {
75
+ public droppable ( el : GridItemHTMLElement , opts : DDOpts | DDDropOpt , key ?: DDKey , value ?: DDValue ) : GridStackDD {
76
76
let $el : JQuery = $ ( el ) ;
77
77
if ( typeof opts . accept === 'function' && ! opts . _accept ) {
78
78
// convert jquery event to generic element
@@ -93,18 +93,18 @@ export class JQueryUIGridStackDragDropPlugin extends GridStackDragDropPlugin {
93
93
return Boolean ( $el . data ( 'ui-draggable' ) ) ;
94
94
}
95
95
96
- public on ( el : GridItemHTMLElement , name : string , callback : DDCallback ) : GridStackDragDropPlugin {
96
+ public on ( el : GridItemHTMLElement , name : string , callback : DDCallback ) : GridStackDD {
97
97
let $el : JQuery = $ ( el ) ;
98
98
$el . on ( name , ( event , ui ) => { callback ( event as any , ui . draggable ? ui . draggable . get ( 0 ) : event . target ) } ) ;
99
99
return this ;
100
100
}
101
101
102
- public off ( el : GridItemHTMLElement , name : string ) : GridStackDragDropPlugin {
102
+ public off ( el : GridItemHTMLElement , name : string ) : GridStackDD {
103
103
let $el : JQuery = $ ( el ) ;
104
104
$el . off ( name ) ;
105
105
return this ;
106
106
}
107
107
}
108
108
109
109
// finally register ourself
110
- GridStackDragDropPlugin . registerPlugin ( JQueryUIGridStackDragDropPlugin ) ;
110
+ GridStackDD . registerPlugin ( GridStackDDJQueryUI ) ;
0 commit comments