Cleanup
This commit is contained in:
parent
68c44d3d72
commit
91dce1895f
@ -207,9 +207,6 @@ export class Application {
|
||||
}
|
||||
|
||||
emit(eventName: string) {
|
||||
document.dispatchEvent(new Event(eventName, {
|
||||
"bubbles": true,
|
||||
"cancelable": true
|
||||
}))
|
||||
document.dispatchEvent(new Event(eventName))
|
||||
}
|
||||
}
|
@ -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() {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user