summaryrefslogtreecommitdiffstats
path: root/src/modules/Events.ts
blob: a135e4585059195e5fe889ec9b52254693adbe8e (plain) (blame)
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
import Fridge from "Modules/Fridge"

export default class Events {
  static setAll(fridge: Fridge) {
    this.setBAdd(fridge)
    // this.docMouMov(fridge);
    // this.docMouLea(fridge);
  }
  static setBAdd(fridge: Fridge) {
    const bAdd = document.getElementById("document-add") as HTMLButtonElement
    bAdd.onclick = () => fridge.createChit();
  }
  // static docMouMov(fridge: Fridge) {
  //   let ox = 100, oy = 100;
  //   document.onmousemove = e => {
  //     if ((e.target as HTMLElement).localName === "div") {
  //       e.preventDefault();
  //       fridge.moveChit({ top: oy - e.y, left: ox - e.x });
  //       [ox, oy] = [e.x, e.y]
  //     }
  //   }
  // }
  // static docMouLea(fridge: Fridge) {
  //   document.onmouseleave = () => {
  //     fridge.stopChitMove()
  //   }
  // }
}