Skip to content

Commit 4d0c376

Browse files
committed
Fix compilation to ES5
1 parent 0ff8686 commit 4d0c376

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/eventHandlers/mousedown.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export function mousedownHandler(
1818
opts: SortableOptions
1919
): [VNode, undefined] {
2020
const item: Element = ev.currentTarget as Element;
21-
const indexClicked = [...item.parentElement.children].indexOf(item);
21+
const indexClicked = Array.prototype.slice
22+
.call(item.parentElement.children)
23+
.indexOf(item);
2224

2325
const children = node.children
2426
.map(addData)

src/eventHandlers/mousemove.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function mousemoveHandler(
1212
.map(n => n.data.dataset.item)
1313
.filter(n => !!n)[0];
1414

15-
const siblings = [...item.parentElement.children];
15+
const siblings = Array.prototype.slice.call(item.parentElement.children);
1616
const index = siblings.indexOf(item);
1717
const ghost = siblings[siblings.length - 1];
1818
const itemArea = getArea(ghost);

tsconfig.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
"compileOnSave": false,
33
"compilerOptions":
44
{
5-
"module": "CommonJS",
5+
"moduleResolution": "node",
66
"sourceMap": true,
7-
"target": "ES6",
8-
"outDir": "build"
7+
"target": "ES5",
8+
"outDir": "build",
9+
"lib": [
10+
"ES6",
11+
"DOM"
12+
]
913
},
1014
"include": [
1115
"src/**/*.ts",

0 commit comments

Comments
 (0)