forked from oobabooga/text-generation-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show/hide the extensions block using javascript
- Loading branch information
Showing
5 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
document.getElementById("main").childNodes[0].style = "max-width: 800px; margin-left: auto; margin-right: auto"; | ||
document.getElementById("extensions").style = "max-width: 800px; margin-left: auto; margin-right: auto"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
document.getElementById("main").parentNode.childNodes[0].style = "border: none; background-color: #8080802b; margin-bottom: 40px"; | ||
document.getElementById("main").parentNode.style = "padding: 0; margin: 0"; | ||
document.getElementById("main").parentNode.parentNode.parentNode.style = "padding: 0"; | ||
|
||
// Get references to the elements | ||
let main = document.getElementById('main'); | ||
let main_parent = main.parentNode; | ||
let extensions = document.getElementById('extensions'); | ||
|
||
// Add an event listener to the main element | ||
main_parent.addEventListener('click', function(e) { | ||
// Check if the main element is visible | ||
if (main.offsetHeight > 0 && main.offsetWidth > 0) { | ||
extensions.style.visibility = 'visible'; | ||
} else { | ||
extensions.style.visibility = 'hidden'; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters