mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Hide extension menu button if all menu elements are invisible
This commit is contained in:
@ -70,13 +70,15 @@ const getApiUrl = () => extension_settings.apiUrl;
|
|||||||
let connectedToApi = false;
|
let connectedToApi = false;
|
||||||
|
|
||||||
function showHideExtensionsMenu() {
|
function showHideExtensionsMenu() {
|
||||||
const hasMenuItems = $('#extensionsMenu').children().length > 0;
|
// Get the number of menu items that are not hidden
|
||||||
|
const hasMenuItems = $('#extensionsMenu').children().filter((_, child) => $(child).css('display') !== 'none').length > 0;
|
||||||
|
|
||||||
// We have menu items, so we can stop checking
|
// We have menu items, so we can stop checking
|
||||||
if (hasMenuItems) {
|
if (hasMenuItems) {
|
||||||
clearInterval(menuInterval);
|
clearInterval(menuInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show or hide the menu button
|
||||||
$('#extensionsMenuButton').toggle(hasMenuItems);
|
$('#extensionsMenuButton').toggle(hasMenuItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user