Skip to content

Commit aeba84e

Browse files
committed
Fixed some ESM issues
1 parent 500c337 commit aeba84e

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"build:umd": "set NODE_ENV=umd&& rollup -c build/umd-build.js",
2020
"build:umd:watch": "set NODE_ENV=umd&& rollup -w -c build/umd-build.js",
2121
"build:es": "set NODE_ENV=es&& rollup -c build/esm-build.js",
22+
"build:es:watch": "set NODE_ENV=es&& rollup -w -c build/esm-build.js",
2223
"minify": "node build/minify.js",
2324
"build": "npm run build:es && npm run build:umd && npm run minify"
2425
},

plugins/AutoScroll/AutoScroll.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
getWindowScrollingElement
1212
} from '../../src/utils.js';
1313

14+
import Sortable from '../../src/Sortable.js';
15+
1416
import { Edge, IE11OrLess, Safari } from '../../src/BrowserInfo.js';
1517

1618
let autoScrolls = [],

plugins/MultiDrag/MultiDrag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ function MultiDragPlugin() {
374374
// Do not "unfold" after around dragEl if reverted
375375
if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {
376376
let dragRect = getRect(dragEl),
377-
multiDragIndex = index(dragEl, ':not(.' + Sortable.active.options.selectedClass + ')');
377+
multiDragIndex = index(dragEl, ':not(.' + this.options.selectedClass + ')');
378378

379379
if (!initialFolding && options.animation) dragEl.thisAnimationDuration = null;
380380

src/Sortable.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,17 +1881,17 @@ Sortable.utils = {
18811881
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
18821882
*/
18831883
Sortable.mount = function(...plugins) {
1884-
if (plugins[0].constructor === Array) plugins = plugins[0];
1884+
if (plugins[0].constructor === Array) plugins = plugins[0];
18851885

1886-
for (let i in plugins) {
1887-
let plugin = plugins[i];
1888-
if (!plugin.prototype || !plugin.prototype.constructor) {
1889-
throw `Sortable: Mounted plugin must be a constructor function, not ${ {}.toString.call(el) }`;
1890-
}
1891-
if (plugin.utils) Sortable.utils = { ...Sortable.utils, ...plugin.utils };
1892-
1893-
PluginManager.mount(plugin);
1886+
for (let i in plugins) {
1887+
let plugin = plugins[i];
1888+
if (!plugin.prototype || !plugin.prototype.constructor) {
1889+
throw `Sortable: Mounted plugin must be a constructor function, not ${ {}.toString.call(el) }`;
18941890
}
1891+
if (plugin.utils) Sortable.utils = { ...Sortable.utils, ...plugin.utils };
1892+
1893+
PluginManager.mount(plugin);
1894+
}
18951895
};
18961896

18971897

0 commit comments

Comments
 (0)