Skip to content

Commit 1280176

Browse files
committed
Upgrade Phoenix and fix error with LiveView
1 parent 53846a5 commit 1280176

29 files changed

+316
-19032
lines changed

assets/.babelrc

-5
This file was deleted.

assets/css/app.scss renamed to assets/css/app.css

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* This file is for your main application css. */
22
@import "./phoenix.css";
3-
@import "../node_modules/nprogress/nprogress.css";
43

54
table td {
65
overflow-wrap: anywhere;

assets/js/app.js

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
1-
// We need to import the CSS so that webpack will load it.
2-
// The MiniCssExtractPlugin is used to separate it out into
3-
// its own CSS file.
4-
import "../css/app.scss";
1+
import "../css/app.css";
52

6-
// webpack automatically bundles all modules in your
7-
// entry points. Those entry points can be configured
8-
// in "webpack.config.js".
9-
//
10-
// Import deps with the dep name or local files with a relative path, for example:
11-
//
12-
// import {Socket} from "phoenix"
13-
// import socket from "./socket"
14-
//
153
import "phoenix_html";
164
import { Socket } from "phoenix";
17-
import NProgress from "nprogress";
5+
import topbar from "topbar";
186
import { LiveSocket } from "phoenix_live_view";
197

208
let csrfToken = document
@@ -25,8 +13,9 @@ let liveSocket = new LiveSocket("/live", Socket, {
2513
});
2614

2715
// Show progress bar on live navigation and form submits
28-
window.addEventListener("phx:page-loading-start", (info) => NProgress.start());
29-
window.addEventListener("phx:page-loading-stop", (info) => NProgress.done());
16+
topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" });
17+
window.addEventListener("phx:page-loading-start", (info) => topbar.show());
18+
window.addEventListener("phx:page-loading-stop", (info) => topbar.hide());
3019

3120
// connect if there are any LiveViews on the page
3221
liveSocket.connect();

0 commit comments

Comments
 (0)