mirror of
https://github.com/ash-project/ash_hq.git
synced 2024-09-19 12:53:49 +12:00
chore: fix topbar behavior & add missing alias
This commit is contained in:
parent
8f98cd17e4
commit
fef150c941
2 changed files with 4 additions and 3 deletions
|
@ -220,7 +220,7 @@ let liveSocket = new LiveSocket("/live", Socket, {
|
|||
topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" });
|
||||
|
||||
let topBarScheduled = undefined;
|
||||
window.addEventListener("phx:page-loading-start", () => {
|
||||
window.addEventListener("phx:page-loading-start", ({ detail }) => {
|
||||
scrolled = false;
|
||||
|
||||
// close mobile sidebar on navigation
|
||||
|
@ -229,13 +229,14 @@ window.addEventListener("phx:page-loading-start", () => {
|
|||
mobileSideBar.click()
|
||||
}
|
||||
|
||||
if (!topBarScheduled) {
|
||||
if (detail.kind !== 'patch' && !topBarScheduled) {
|
||||
topBarScheduled = setTimeout(() => topbar.show(), 500);
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener("phx:page-loading-stop", ({ detail }) => {
|
||||
clearTimeout(topBarScheduled);
|
||||
topbar.hide();
|
||||
topBarScheduled = undefined;
|
||||
let scrollEl;
|
||||
if (detail.kind === "initial" && window.location.hash) {
|
||||
|
@ -251,7 +252,6 @@ window.addEventListener("phx:page-loading-stop", ({ detail }) => {
|
|||
} else {
|
||||
scrolled = true;
|
||||
}
|
||||
topbar.hide();
|
||||
});
|
||||
|
||||
window.addEventListener("js:focus", (e) => e.target.focus());
|
||||
|
|
|
@ -8,6 +8,7 @@ defmodule AshHqWeb.Components.TreeView do
|
|||
|
||||
use Surface.Component
|
||||
alias AshHqWeb.Components.TreeView.Item
|
||||
alias Surface.Components.LivePatch
|
||||
alias Phoenix.LiveView.JS
|
||||
alias Surface.Components.LivePatch
|
||||
|
||||
|
|
Loading…
Reference in a new issue