fix(HEL-529): 减少动态挂到 body/#app 覆盖抽屉弹层过渡

审核返工:reduce-motion 原先只挂 #appRoot,兄弟节点 drawer/modal/toast
的 CSS transition 仍生效;改为挂 body 与 #app,computed duration 归零。

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
总工
2026-09-14 21:38:06 +08:00
co-authored by Cursor multica-agent
parent 31da37b49e
commit d9358ab377
+5 -1
View File
@@ -1021,7 +1021,11 @@ function updateClock() {
} }
function applyCalm(on) { function applyCalm(on) {
state.calm = on; state.calm = on;
$('appRoot').classList.toggle('reduce-motion', on); // 挂在 #app(覆盖 appRoot 及其兄弟 drawer/modal/toast),不能只挂 #appRoot
// 否则 .reduce-motion * 与 .reduce-motion .drawer/.toast 选不中旁路层过渡。
document.body.classList.toggle('reduce-motion', on);
const app = $('app');
if (app) app.classList.toggle('reduce-motion', on);
$('calmBtn').textContent = on ? '恢复动态' : '减少动态'; $('calmBtn').textContent = on ? '恢复动态' : '减少动态';
$('calmBtn').classList.toggle('on', on); $('calmBtn').classList.toggle('on', on);
} }