Mobile layout

This commit is contained in:
2017-07-19 16:56:02 +02:00
parent 39e6853d7d
commit 6fbe6a34ab
8 changed files with 122 additions and 18 deletions

View File

@ -3,6 +3,11 @@ import { AnimeNotifier } from "./AnimeNotifier"
import { Diff } from "./Diff"
import { findAll } from "./Utils"
// Toggle sidebar
export function toggleSidebar(arn: AnimeNotifier) {
arn.app.find("sidebar").classList.toggle("sidebar-visible")
}
// Save new data from an input field
export function save(arn: AnimeNotifier, input: HTMLElement) {
arn.loading(true)

View File

@ -115,6 +115,11 @@ export class AnimeNotifier {
// Push manager
this.pushManager = new PushManager()
// Sidebar control
document.body.addEventListener("click", e => {
this.app.find("sidebar").classList.remove("sidebar-visible")
})
}
async onContentLoaded() {

View File

@ -160,7 +160,10 @@ export class Application {
let url = this.getAttribute("href")
e.preventDefault()
e.stopPropagation()
// if(this.dataset.bubble !== "true") {
// e.stopPropagation()
// }
if(!url || url === self.currentPath)
return