mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-22 20:51:58 +00:00
theme.js refactoring
the function hide has been refactored to toggleVisibility. The target element id is now given by a parameter.
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
export function hide() {
|
||||
var x = document.getElementById('heading');
|
||||
export function toggleVisibility(id) {
|
||||
var element = document.getElementById(id);
|
||||
var isHided = element.style.display === "none";
|
||||
|
||||
if (x.style.display === "none") {
|
||||
x.style.display = "block";
|
||||
} else {
|
||||
x.style.display = "none";
|
||||
}
|
||||
element.style.display = isHided ? "block" : "none";
|
||||
}
|
||||
|
||||
window.hide = hide;
|
||||
window.toggleVisibility = toggleVisibility;
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
</div>
|
||||
|
||||
<div class="short-menu-right">
|
||||
<div class="short-menu-right-h" onclick="hide();">
|
||||
<div class="short-menu-right-h" onclick="toggleVisibility('heading');">
|
||||
|
||||
<i class="fa fa-bars fa-lg"></i><span style="margin-left:3px;">Menu</span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user