Sha256: c19f10b818e8cc4882c9e5866687e46b8e3f18be0ec9d6523c0b57744e7e5b8f
Contents?: true
Size: 1.06 KB
Versions: 13
Compression:
Stored size: 1.06 KB
Contents
import morph from "./utils/morph"; export default function () { return { clearFilter() { this.$store.nav.filter = ""; }, init() { this.$watch("$store.nav.filter", (value) => { const nav = this.$store.nav; nav.filterText = value.replace(/\s/g, "").toLowerCase(); nav.filtering = nav.filterText.length > 0; }); }, updateNav(event) { const nav = document.getElementById("nav"); nav.style.height = `${this.$refs.shim.offsetHeight}px`; morph(nav, event.detail.doc.getElementById("nav")); Promise.resolve().then(() => { this.$refs.shim.style.height = "auto"; this.$dispatch("nav:updated"); }); }, navigate(path) { if (path instanceof Event) { path = path.currentTarget.href; } history.pushState({}, null, path); this.$dispatch("popstate"); }, focusFilter() { this.currentFocus = this.$refs.filter; setTimeout(() => this.$refs.filter.focus(), 0); }, unfocusFilter() { this.$refs.filter.blur(); }, }; }
Version data entries
13 entries across 13 versions & 1 rubygems