Skip to content

Commit 91c396b

Browse files
committed
refactor: fix path issue
1 parent 4036282 commit 91c396b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build/assets/js/soft-ui-dashboard-tailwind.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
1717
*/
1818
var page = window.location.pathname.split("/").pop().split(".")[0];
19-
var to_build = "../";
20-
if(page == "index" ){
19+
var aux = window.location.pathname.split("/");
20+
var to_build = (aux.includes('pages')?'../':'./');
21+
var root = window.location.pathname.split("/")
22+
if (!aux.includes("pages")) {
2123
page = "dashboard";
22-
to_build = "./";
2324
}
2425

2526
loadStylesheet(to_build + "assets/css/perfect-scrollbar.css");

build/assets/js/soft-ui-dashboard-tailwind.min.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@
1414
1515
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1616
17-
*/
18-
if(window.location.pathname.length>1)var b=window.location.pathname.split("/").pop().split(".")[0];else var b="dashboard";function a(b,c){let a=document.createElement("script");a.setAttribute("src",b),a.setAttribute("type","text/javascript"),a.setAttribute("async",c),document.head.appendChild(a)}function c(b){let a=document.createElement("link");a.setAttribute("href",b),a.setAttribute("type","text/css"),a.setAttribute("rel","stylesheet"),document.head.appendChild(a)}c("../assets/css/perfect-scrollbar.css"),a("../assets/js/perfect-scrollbar.js",!0),"sign-in"!=b&&"sign-up"!=b?(a("../assets/js/fixed-plugin.js",!0),a("../assets/js/sidenav-burger.js",!0),a("../assets/js/dropdown.js",!0),a("profile"!=b?"../assets/js/navbar-sticky.js":"../assets/js/nav-pills.js",!0),"tables"!=b&&(a("../assets/js/tooltips.js",!0),c("../assets/css/tooltips.css"))):a("../assets/js/navbar-collapse.js",!0),document.querySelector("canvas")&&(a("../assets/js/chart-1.js",!0),a("../assets/js/chart-2.js",!0))
17+
*/ var page=window.location.pathname.split("/").pop().split(".")[0],aux=window.location.pathname.split("/"),to_build=aux.includes("pages")?"../":"./",root=window.location.pathname.split("/");function loadJS(b,c){let a=document.createElement("script");a.setAttribute("src",b),a.setAttribute("type","text/javascript"),a.setAttribute("async",c),document.head.appendChild(a)}function loadStylesheet(b){let a=document.createElement("link");a.setAttribute("href",b),a.setAttribute("type","text/css"),a.setAttribute("rel","stylesheet"),document.head.appendChild(a)}aux.includes("pages")||(page="dashboard"),loadStylesheet(to_build+"assets/css/perfect-scrollbar.css"),loadJS(to_build+"assets/js/perfect-scrollbar.js",!0),"sign-in"!=page&&"sign-up"!=page?(loadJS(to_build+"assets/js/fixed-plugin.js",!0),loadJS(to_build+"assets/js/sidenav-burger.js",!0),loadJS(to_build+"assets/js/dropdown.js",!0),loadJS("profile"!=page?to_build+"assets/js/navbar-sticky.js":to_build+"assets/js/nav-pills.js",!0),"tables"!=page&&(loadJS(to_build+"assets/js/tooltips.js",!0),loadStylesheet(to_build+"assets/css/tooltips.css"))):loadJS(to_build+"assets/js/navbar-collapse.js",!0),document.querySelector("canvas")&&(loadJS(to_build+"assets/js/chart-1.js",!0),loadJS(to_build+"assets/js/chart-2.js",!0))

0 commit comments

Comments
 (0)