-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
68 lines (58 loc) · 1.92 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
namespace `root` (
class Main extends Application {
async onConnected() {
await super.onConnected();
alert("asd")
window.meld = meld;
this.on("dragstart", e=> this.onDragStart(e), true, ".draggable");
this.on("dragend", e=> this.onDragEnd(e), true, ".draggable");
this.on("dragover", e=> this.onDragOver(e), true, ".slot");
this.on("dragenter", e=> this.onDragEnter(e), true, ".slot");
this.on("dragleave", e=> this.onDragLeave(e), true, ".slot");
this.on("drop", e=> this.onDrop(e), true, ".slot");
// this.before('onDragStart', e => {
// // debugger;
// console.log("onDragStart",e)
// // console.log(methodCall.args)
// // methodCall.proceed();
// });
// this.before('onDrop', e => {
// console.log("onDrop",e)
// })
}
around(method,func){
meld.around(this, method, func)
}
before(method,func){
meld.before(this, method, func)
}
after(method,func){
meld.after(this, method, func)
}
async onDragStart(e) {
// e.target.classList.add("hold");
// await wait(100);
// e.target.className = "";
this.item = e.target;
}
onDragEnd(e) {
// e.target.className = "fill";
}
onDragOver(e) {
e.preventDefault();
}
onDragEnter(e) {
e.preventDefault();
e.target.classList.add("hovered");
}
onDragLeave(e) {
e.target.classList.remove("hovered");
}
onDrop(e) {
e.target.classList.remove("hovered");
e.target.append(this.item);
}
}
);
var m = root.Main;
export {m}