Skip to content

Commit 4617cec

Browse files
committed
more jquery cleanup
* removed revert: 'invalid', scroll: false support as those were never implemented in H5 * combined more classes and moved DD around
1 parent 065d631 commit 4617cec

15 files changed

+104
-110
lines changed

demo/drag-and-drop-dataTransfer-angular.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
const _ddElement = DDElement.init(this.dragElement.nativeElement);
3333
_ddElement.setupDraggable({
3434
handle: '.sample-drag',
35-
revert: 'invalid',
36-
scroll: true,
3735
appendTo: 'body',
3836
helper: 'clone',
3937
start: (event: DragEvent) => {

demo/drag-and-drop-dataTransfer.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ <h1>Event DataTransfer Demo</h1>
5555
GridStack.setupDragIn(
5656
'.sidebar .grid-stack-item',
5757
{
58-
revert: 'invalid',
59-
scroll: false,
6058
appendTo: 'body',
6159
helper: clone,
6260
start: start

demo/static.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h1>Static vs can move/drag Demo</h1>
3838
removable: true,
3939
// old way, use global setupDragIn() instead
4040
// dragIn: '.sidebar .grid-stack-item', // add draggable to class
41-
// dragInOptions: { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' },
41+
// dragInOptions: { appendTo: 'body', helper: 'clone' },
4242
staticGrid: true
4343
});
4444
addEvents(grid);
@@ -52,7 +52,7 @@ <h1>Static vs can move/drag Demo</h1>
5252
];
5353
grid.load(serializedData, true);
5454

55-
GridStack.setupDragIn('.sidebar .grid-stack-item', { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' });
55+
GridStack.setupDragIn('.sidebar .grid-stack-item', { appendTo: 'body', helper: 'clone' });
5656

5757
// grid.setStatic(false); // TEST enable after disabled
5858

demo/two.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ <h1>Two grids demo</h1>
5757
disableOneColumnMode: true,
5858
float: true,
5959
// dragIn: '.sidebar .grid-stack-item', // add draggable to class
60-
// dragInOptions: { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' }, // clone
60+
// dragInOptions: { appendTo: 'body', helper: 'clone' }, // clone
6161
removable: '.trash', // true or drag-out delete class
6262
acceptWidgets: function(el) { return true; } // function example, but can also be: true | false | '.someClass' value
6363
};
6464
let grids = GridStack.initAll(options);
6565
grids[1].float(false);
6666

6767
// new 4.x static method instead of setting up options on every grid (never been per grid really) but old options still works
68-
GridStack.setupDragIn('.sidebar .grid-stack-item', { revert: 'invalid', scroll: false, appendTo: 'body', helper: myClone });
68+
GridStack.setupDragIn('.sidebar .grid-stack-item', { appendTo: 'body', helper: myClone });
6969
// GridStack.setupDragIn(); // second call will now work (cache last values)
7070

7171
let items = [

demo/web2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h1>Advanced Demo</h1>
6262
cellHeight: 70,
6363
acceptWidgets: true,
6464
dragIn: '.newWidget', // class that can be dragged from outside
65-
dragInOptions: { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' }, // clone or can be your function
65+
dragInOptions: { appendTo: 'body', helper: 'clone' }, // clone or can be your function
6666
removable: '#trash', // drag-out delete class
6767
});
6868

demo/website.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>Used by</h1>
374374
margin: 5,
375375
acceptWidgets: true,
376376
dragIn: '.newWidget', // class that can be dragged from outside
377-
dragInOptions: { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' },
377+
dragInOptions: { appendTo: 'body', helper: 'clone' },
378378
removable: '#trash',
379379
removeTimeout: 100
380380
}, '#advanced-grid');

doc/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ gridstack.js API
9595
* example: `dragIn: '.newWidget'`.
9696
* **Note**: if you have multiple grids, it's best to call `GridStack.setupDragIn()` with same params as it only need to be done once.
9797
- `dragInOptions` - options for items that can be dragged into grids
98-
* example `dragInOptions: { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone', handle: '.grid-stack-item-content' }`
98+
* example `dragInOptions: { appendTo: 'body', helper: 'clone', handle: '.grid-stack-item-content' }`
9999
* **Note**: if you have multiple grids, it's best to call `GridStack.setupDragIn()` with same params as it only need to be done once.
100100
* **Note2**: instead of 'clone' you can also pass your own function (get passed the event).
101-
- `draggable` - allows to override draggable options. (default: `{handle: '.grid-stack-item-content', scroll: false, appendTo: 'body', containment: null}`)
101+
- `draggable` - allows to override draggable options. (default: `{handle: '.grid-stack-item-content', appendTo: 'body'}`)
102102
- `dragOut` to let user drag nested grid items out of a parent or not (default false) See [example](http://gridstackjs.com/demo/nested.html)
103103
- `engineClass` - the type of engine to create (so you can subclass) default to GridStackEngine
104104
- `float` - enable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html)
@@ -319,7 +319,7 @@ grids.forEach(...)
319319
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
320320
Called during `GridStack.init()` as options, but can also be called directly (last param are cached) in case the toolbar is dynamically create and needs to change later.
321321
* @param dragIn string selector (ex: `'.sidebar .grid-stack-item'`)
322-
* @param dragInOptions options - see `DDDragInOpt`. (default: `{revert: 'invalid', handle: '.grid-stack-item-content', scroll: false, appendTo: 'body'}`
322+
* @param dragInOptions options - see `DDDragInOpt`. (default: `{handle: '.grid-stack-item-content', appendTo: 'body'}`
323323
but you will probably also want `helper: 'clone'` or your own callback function).
324324

325325

spec/e2e/html/1143_nested_acceptWidget_types.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h3>show dragging into sub grid</h3>
5050
let gridNest = GridStack.init({
5151
acceptWidgets: '.newWidget',
5252
dragIn: '.newWidget', // class that can be dragged from outside
53-
dragInOptions: { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' }, // clone or can be your function
53+
dragInOptions: { appendTo: 'body', helper: 'clone' }, // clone or can be your function
5454
itemClass: 'sub',
5555
}, '.grid-stack.nested');
5656
gridNest.load([

spec/e2e/html/1419-maxrow1-cant-insert.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
row: 1,
6363
cellHeight: 120,
6464
dragIn: '.sidebar .grid-stack-item', // class that can be dragged from outside
65-
dragInOptions: { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' }, // clone or can be your function
65+
dragInOptions: { appendTo: 'body', helper: 'clone' }, // clone or can be your function
6666
acceptWidgets: true
6767
};
6868
let grid = GridStack.init(options);

spec/e2e/html/1571_drop_onto_full.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ <h1>drop onto full</h1>
8787
disableOneColumnMode: true,
8888
float: false,
8989
dragIn: '.sidebar .grid-stack-item', // class that can be dragged from outside
90-
dragInOptions: { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' }, // clone or can be your function
90+
dragInOptions: { appendTo: 'body', helper: 'clone' }, // clone or can be your function
9191
removable: '.trash', // drag-out delete class
9292
acceptWidgets: function(el) { return true; } // function example, else can be simple: true | false | '.someClass' value
9393
};

0 commit comments

Comments
 (0)