Cleanup
This commit is contained in:
parent
68c44d3d72
commit
91dce1895f
@ -207,9 +207,6 @@ export class Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
emit(eventName: string) {
|
emit(eventName: string) {
|
||||||
document.dispatchEvent(new Event(eventName, {
|
document.dispatchEvent(new Event(eventName))
|
||||||
"bubbles": true,
|
|
||||||
"cancelable": true
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,5 @@
|
|||||||
import { TouchController } from "./TouchController"
|
import { TouchController } from "./TouchController"
|
||||||
|
import { Diff } from "./Diff"
|
||||||
|
|
||||||
export class SideBar {
|
export class SideBar {
|
||||||
element: HTMLElement
|
element: HTMLElement
|
||||||
@ -20,11 +21,11 @@ export class SideBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this.element.classList.add("sidebar-visible")
|
Diff.mutations.queue(() => this.element.classList.add("sidebar-visible"))
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this.element.classList.remove("sidebar-visible")
|
Diff.mutations.queue(() => this.element.classList.remove("sidebar-visible"))
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
|
@ -15,15 +15,7 @@ export function plural(count: number, singular: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canUseWebP(): boolean {
|
export function canUseWebP(): boolean {
|
||||||
let canvas = document.createElement("canvas")
|
return document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp") === 0
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function swapElements(a: Node, b: Node) {
|
export function swapElements(a: Node, b: Node) {
|
||||||
|
Loading…
Reference in New Issue
Block a user