diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2021-10-24 18:59:50 +0200 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2021-10-24 18:59:50 +0200 |
| commit | 55d0e202677253ecf893bd52649871f10b52d3de (patch) | |
| tree | 23fc8b3b06bef4ff7503c100edcea2ed01a298d5 /src/modules/Events.ts | |
| parent | 94ca5987544009f2da17fe27abc6c9de380d34fd (diff) | |
| download | isiqandisi-55d0e202677253ecf893bd52649871f10b52d3de.tar.gz isiqandisi-55d0e202677253ecf893bd52649871f10b52d3de.tar.zst isiqandisi-55d0e202677253ecf893bd52649871f10b52d3de.zip | |
Almost dragging and WYSiWYG start
Diffstat (limited to 'src/modules/Events.ts')
| -rw-r--r-- | src/modules/Events.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/modules/Events.ts b/src/modules/Events.ts new file mode 100644 index 0000000..a135e45 --- /dev/null +++ b/src/modules/Events.ts @@ -0,0 +1,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() + // } + // } +} |
