mirror of
https://github.com/phfroidmont/scalive.git
synced 2025-12-25 05:26:59 +01:00
Add title and topbar
This commit is contained in:
parent
124239925d
commit
fca87a4263
5 changed files with 14 additions and 10 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { Socket } from "phoenix"
|
||||
import { LiveSocket } from "phoenix_live_view"
|
||||
// import topbar from "../vendor/topbar"
|
||||
// import Calendar from "./hooks/calendar"
|
||||
import topbar from "topbar"
|
||||
|
||||
// let csrfToken =
|
||||
// document.querySelector("meta[name='csrf-token']").getAttribute("content")
|
||||
|
|
@ -12,9 +11,9 @@ let liveSocket = new LiveSocket("/live", Socket, {
|
|||
});
|
||||
|
||||
// Show progress bar on live navigation and form submits
|
||||
// topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" })
|
||||
// window.addEventListener("phx:page-loading-start", info => topbar.delayedShow(200))
|
||||
// window.addEventListener("phx:page-loading-stop", info => topbar.hide())
|
||||
topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" })
|
||||
window.addEventListener("phx:page-loading-start", _info => topbar.show(300))
|
||||
window.addEventListener("phx:page-loading-stop", _info => topbar.hide())
|
||||
|
||||
// connect if there are any LiveViews on the page
|
||||
liveSocket.connect()
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@ object RootLayout:
|
|||
htmlRootTag(
|
||||
lang := "en",
|
||||
headTag(
|
||||
metaTag(charset := "utf-8"),
|
||||
scriptTag(defer := true, typ := "text/javascript", src := "/static/app.js")
|
||||
metaTag(charset := "utf-8"),
|
||||
metaTag(nameAttr := "viewport", contentAttr := "width=device-width, initial-scale=1"),
|
||||
scriptTag(defer := true, typ := "text/javascript", src := "/static/app.js"),
|
||||
titleTag("Scalive Example")
|
||||
),
|
||||
bodyTag(
|
||||
content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue