This commit is contained in:
Eduard Urbach 2018-03-29 11:36:54 +02:00
parent 68c44d3d72
commit 91dce1895f
3 changed files with 5 additions and 15 deletions

View File

@ -207,9 +207,6 @@ export class Application {
}
emit(eventName: string) {
document.dispatchEvent(new Event(eventName, {
"bubbles": true,
"cancelable": true
}))
document.dispatchEvent(new Event(eventName))
}
}

View File

@ -1,4 +1,5 @@
import { TouchController } from "./TouchController"
import { Diff } from "./Diff"
export class SideBar {
element: HTMLElement
@ -20,11 +21,11 @@ export class SideBar {
}
show() {
this.element.classList.add("sidebar-visible")
Diff.mutations.queue(() => this.element.classList.add("sidebar-visible"))
}
hide() {
this.element.classList.remove("sidebar-visible")
Diff.mutations.queue(() => this.element.classList.remove("sidebar-visible"))
}
toggle() {

View File

@ -15,15 +15,7 @@ export function plural(count: number, singular: string): string {
}
export function canUseWebP(): boolean {
let canvas = document.createElement("canvas")
if(!!(canvas.getContext && canvas.getContext("2d"))) {
// WebP representation possible
return canvas.toDataURL("image/webp").indexOf("data:image/webp") === 0
} else {
// In very old browsers (IE 8) canvas is not supported
return false
}
return document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp") === 0
}
export function swapElements(a: Node, b: Node) {