diff --git a/public/js/admin.js b/public/js/admin.js index 87bc77d..4082912 100644 --- a/public/js/admin.js +++ b/public/js/admin.js @@ -97,7 +97,16 @@ posts_edit_regexp = new RegExp("/admin/posts/\\d+/edit"); now_edit_regexp = new RegExp("/admin/now/\\d+/edit"); projects_edit_regexp = new RegExp("/admin/projects/\\d+/edit"); setups_edit_regexp = new RegExp("/admin/setups/\\d+/edit"); -if (window.location.pathname === "/admin/posts" || window.location.pathname === "/admin/posts/create" || window.location.pathname.match(posts_edit_regexp)) document.getElementById("posts-link").classList.add("pure-menu-highlight");else if (window.location.pathname === "/admin/now" || window.location.pathname === "/admin/now/create" || window.location.pathname.match(now_edit_regexp)) document.getElementById("now-link").classList.add("pure-menu-highlight");else if (window.location.pathname === "/admin/projects" || window.location.pathname === "/admin/projects/create" || window.location.pathname.match(projects_edit_regexp)) document.getElementById("projects-link").classList.add("pure-menu-highlight");else if (window.location.pathname === "/admin/setups" || window.location.pathname === "/admin/setups/create" || window.location.pathname.match(setups_edit_regexp)) document.getElementById("setup-link").classList.add("pure-menu-highlight"); + +if (window.location.pathname === "/admin/posts" || window.location.pathname === "/admin/posts/create" || window.location.pathname.match(posts_edit_regexp)) { + document.getElementById("posts-link").classList.add("menu-highlight"); +} else if (window.location.pathname === "/admin/now" || window.location.pathname === "/admin/now/create" || window.location.pathname.match(now_edit_regexp)) { + document.getElementById("now-link").classList.add("menu-highlight"); +} else if (window.location.pathname === "/admin/projects" || window.location.pathname === "/admin/projects/create" || window.location.pathname.match(projects_edit_regexp)) { + document.getElementById("projects-link").classList.add("menu-highlight"); +} else if (window.location.pathname === "/admin/setups" || window.location.pathname === "/admin/setups/create" || window.location.pathname.match(setups_edit_regexp)) { + document.getElementById("setup-link").classList.add("menu-highlight"); +} /***/ }), diff --git a/resources/js/admin.js b/resources/js/admin.js index 30d5c17..a5d45f0 100644 --- a/resources/js/admin.js +++ b/resources/js/admin.js @@ -7,26 +7,24 @@ if( window.location.pathname === "/admin/posts" || window.location.pathname === "/admin/posts/create" || window.location.pathname.match(posts_edit_regexp) -) - document.getElementById("posts-link").classList.add("pure-menu-highlight"); - -else if( +){ + document.getElementById("posts-link").classList.add("menu-highlight"); +} else if( window.location.pathname === "/admin/now" || window.location.pathname === "/admin/now/create" || window.location.pathname.match(now_edit_regexp) -) - document.getElementById("now-link").classList.add("pure-menu-highlight"); - -else if( +){ + document.getElementById("now-link").classList.add("menu-highlight"); +} else if( window.location.pathname === "/admin/projects" || window.location.pathname === "/admin/projects/create" || window.location.pathname.match(projects_edit_regexp) -) - document.getElementById("projects-link").classList.add("pure-menu-highlight"); - -else if( +){ + document.getElementById("projects-link").classList.add("menu-highlight"); +} else if( window.location.pathname === "/admin/setups" || window.location.pathname === "/admin/setups/create" || window.location.pathname.match(setups_edit_regexp) -) - document.getElementById("setup-link").classList.add("pure-menu-highlight"); +){ + document.getElementById("setup-link").classList.add("menu-highlight"); +} diff --git a/resources/views/now/index.blade.php b/resources/views/now/index.blade.php index 1c6fb3f..cbe62d4 100644 --- a/resources/views/now/index.blade.php +++ b/resources/views/now/index.blade.php @@ -12,5 +12,4 @@ {!! $parse->text($now->md) !!} -
@endsection