Ajustes visuais no comportamento da função de mostrar/ocultar a sidebar
This commit is contained in:
@@ -285,44 +285,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
mount?.remove();
|
||||
hcmTile?.remove();
|
||||
|
||||
const header = document.querySelector(SELECTORS.header);
|
||||
const functionsContainer = header?.querySelector(SELECTORS.functions);
|
||||
const anchor = functionsContainer ? findUserAnchor(functionsContainer) : null;
|
||||
|
||||
if (!header || !functionsContainer) {
|
||||
return;
|
||||
}
|
||||
|
||||
ensureStyles();
|
||||
|
||||
const themedMount = mount ?? createMount();
|
||||
const overlay = ensureModal();
|
||||
|
||||
applyTheme(header, functionsContainer, anchor, themedMount, overlay);
|
||||
|
||||
const targetSibling = resolveInsertionTarget(
|
||||
functionsContainer,
|
||||
anchor,
|
||||
themedMount
|
||||
);
|
||||
|
||||
if (
|
||||
themedMount.parentElement !== functionsContainer ||
|
||||
themedMount.nextElementSibling !== targetSibling
|
||||
) {
|
||||
const verifiedTarget =
|
||||
targetSibling && targetSibling.parentElement === functionsContainer
|
||||
? targetSibling
|
||||
: null;
|
||||
|
||||
if (verifiedTarget) {
|
||||
functionsContainer.insertBefore(themedMount, verifiedTarget);
|
||||
} else {
|
||||
functionsContainer.appendChild(themedMount);
|
||||
}
|
||||
}
|
||||
removeModal();
|
||||
unlockScroll();
|
||||
}
|
||||
|
||||
function createMount() {
|
||||
@@ -507,7 +473,8 @@
|
||||
if (
|
||||
action === "calendar-prev" ||
|
||||
action === "calendar-next" ||
|
||||
action === "calendar-today"
|
||||
action === "calendar-today" ||
|
||||
action === "toggle-sidebar"
|
||||
) {
|
||||
return `[data-action="${action}"]`;
|
||||
}
|
||||
@@ -559,14 +526,6 @@
|
||||
<span class="arch-panel-extension-shell-note">
|
||||
${getHeaderSummary()}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="arch-panel-extension-theme-toggle"
|
||||
data-action="toggle-sidebar"
|
||||
aria-label="Toggle sidebar"
|
||||
>
|
||||
${appState.sidebarCollapsed ? "Show sidebar" : "Hide sidebar"}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="arch-panel-extension-theme-toggle"
|
||||
|
||||
Reference in New Issue
Block a user