mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-18 16:48:28 -04:00
♻️ Move home switcher JS to external file
This commit is contained in:
@@ -1,27 +1,8 @@
|
||||
{{ $jsHome := resources.Get "js/home.js" | resources.Minify | resources.Fingerprint "sha512" }}
|
||||
<div id="page">
|
||||
{{ partial "partials/home/page.html" . }}
|
||||
</div>
|
||||
<div id="profile" class="hidden h-full">
|
||||
{{ partial "partials/home/profile.html" . }}
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function switchLayout() {
|
||||
const pageDiv = document.getElementById("page");
|
||||
const profileDiv = document.getElementById("profile");
|
||||
const layoutCode = document.querySelectorAll("code[id=layout]");
|
||||
if (pageDiv.style.display === "none") {
|
||||
pageDiv.style.display = "block";
|
||||
profileDiv.style.display = "none";
|
||||
layoutCode.forEach(function (el) {
|
||||
el.innerText = "page";
|
||||
});
|
||||
} else {
|
||||
pageDiv.style.display = "none";
|
||||
profileDiv.style.display = "block";
|
||||
layoutCode.forEach(function (el) {
|
||||
el.innerText = "profile";
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script defer type="text/javascript" src="{{ $jsHome.RelPermalink }}" integrity="{{ $jsHome.Data.Integrity }}"></script>
|
||||
|
||||
Reference in New Issue
Block a user