mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-07 21:52:20 +01:00
Preserve preview harness, editor, email and task improvements
Snapshot current maintainer-preview application changes and regression fixtures for integration into lab. Excludes local runtime data, evaluation outputs and source backups. Focused Python regression selection: 140 passed; full suite not certified.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { registerEscapeLayer } from './escMenuStack.js';
|
||||
|
||||
// Give every tutorial hint the same button, timeout, and Escape lifecycle.
|
||||
// The global Escape arbiter closes one layer before its underlying window.
|
||||
export function bindTourHintDismiss(hint, { timeout, fade = 280, onDismiss } = {}) {
|
||||
let closed = false;
|
||||
let timer;
|
||||
const button = hint.querySelector('.tour-hint-dismiss');
|
||||
const unregister = registerEscapeLayer(close, () => hint.isConnected && !closed);
|
||||
|
||||
function close() {
|
||||
if (closed) return;
|
||||
closed = true;
|
||||
clearTimeout(timer);
|
||||
unregister();
|
||||
button?.removeEventListener('click', close);
|
||||
hint.classList.add('tour-hint-out');
|
||||
setTimeout(() => hint.remove(), fade);
|
||||
onDismiss?.();
|
||||
}
|
||||
|
||||
button?.addEventListener('click', close);
|
||||
if (timeout > 0) timer = setTimeout(close, timeout);
|
||||
hint._dismiss = close;
|
||||
return close;
|
||||
}
|
||||
Reference in New Issue
Block a user