Sha256: e8da438eb244e43f3b8e6a8d62f9441ce2d9c80eea1e73709111dd008bdd2490
Contents?: true
Size: 1.06 KB
Versions: 2
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) { this.navigateTo(path instanceof Event ? path.currentTarget.href : path); }, focusFilter($event) { if ($event.target.tagName === "INPUT") { return; } this.currentFocus = this.$refs.filter; setTimeout(() => this.$refs.filter.focus(), 0); }, unfocusFilter() { this.$refs.filter.blur(); }, }; }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lookbook-0.4.6 | app/assets/lookbook/js/nav.js |
lookbook-0.4.5 | app/assets/lookbook/js/nav.js |