Skip to content

Commit e4893a8

Browse files
committed
JQ droppable fix for website
1 parent c3e97d9 commit e4893a8

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

demo/web1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<script type="module" src="https://unpkg.com/ionicons@4.5.10-0/dist/ionicons/ionicons.esm.js"></script>
1414
<script nomodule="" src="https://unpkg.com/ionicons@4.5.10-0/dist/ionicons/ionicons.js"></script>
1515

16-
<script src="../dist/gridstack-h5.js"></script>
16+
<script src="../dist/gridstack-jq.js"></script>
1717
</head>
1818

1919
<body>

demo/web2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<script type="module" src="https://unpkg.com/ionicons@4.5.10-0/dist/ionicons/ionicons.esm.js"></script>
1414
<script nomodule="" src="https://unpkg.com/ionicons@4.5.10-0/dist/ionicons/ionicons.js"></script>
1515

16-
<script src="../dist/gridstack-h5.js"></script>
16+
<script src="../dist/gridstack-jq.js"></script>
1717

1818
<style type="text/css">
1919
.grid-stack-item-removing {

doc/CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change log
55
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
66
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
77

8+
- [4.2.5 (2021-5-31)](#425-2021-5-31)
89
- [4.2.4 (2021-5-29)](#424-2021-5-29)
910
- [4.2.3 (2021-5-8)](#423-2021-5-8)
1011
- [4.2.2 (2021-4-23)](#422-2021-4-23)
@@ -57,6 +58,10 @@ Change log
5758
- [v0.1.0 (2014-11-18)](#v010-2014-11-18)
5859

5960
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
61+
## 4.2.5 (2021-5-31)
62+
63+
* fix for website with JQ `droppable('destroy')` giving error
64+
6065
## 4.2.4 (2021-5-29)
6166

6267
* fix [#1760](https://github.com/gridstack/gridstack.js/issues/1760) `removable:true` working again (broke in 4.x)

src/jq/gridstack-dd-jqueryui.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ export class GridStackDDJQueryUI extends GridStackDD {
9090
opts._accept = opts.accept;
9191
opts.accept = ($el: JQuery) => opts._accept($el.get(0));
9292
}
93-
$el.droppable(opts, key, value);
93+
if (opts === 'disable' || opts === 'destroy') {
94+
if ($el.data('ui-droppable')) { // error to call destroy if not there
95+
$el.droppable(opts);
96+
}
97+
} else {
98+
$el.droppable(opts, key, value);
99+
}
94100
return this;
95101
}
96102

0 commit comments

Comments
 (0)