Update visibility handling in ZenWorkspaces by replacing position styles with hidden attribute

This commit is contained in:
mr. M
2025-02-14 19:42:48 +01:00
parent 1a293fc5ff
commit bf91ffddf3

View File

@@ -1495,9 +1495,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
container.style.transform = `translateX(${newTransform + offsetPixels / 2}%)`;
container.style.opacity = offsetPixels ? 1 : !newTransform;
if (!offsetPixels && !container.hasAttribute('active')) {
container.style.position = 'fixed';
container.setAttribute('hidden', 'true');
} else {
container.style.removeProperty('position');
container.removeAttribute('hidden');
}
}
}
@@ -1541,7 +1541,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const newTransform = `translateX(${offset}%)`;
const isCurrent = offset === 0;
if (shouldAnimate) {
element.style.removeProperty('position');
element.removeAttribute('hidden');
if (isCurrent) {
element.style.opacity = 1;
}