Merge pull request #23 from ok2/codex/fix-system-issue-after-update
Fix initialization timing for CoBiE UI
This commit is contained in:
commit
6371a195ea
20
script.js
20
script.js
@ -1,6 +1,13 @@
|
||||
// CoBiE Time System Implementation
|
||||
// Using Unix TAI epoch (January 1, 1970, 00:00:00 TAI)
|
||||
// Note: TAI differs from UTC by leap seconds (37 seconds as of 2025)
|
||||
|
||||
(function() {
|
||||
if (!window.Cobie) {
|
||||
console.error('cobie.js not loaded');
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
COBIE_EPOCH,
|
||||
COBIE_UNITS,
|
||||
@ -794,6 +801,7 @@ function commitInput() {
|
||||
span.addEventListener('click', enterEdit);
|
||||
}
|
||||
|
||||
function init() {
|
||||
// Timezone change handler
|
||||
document.getElementById('timezone').addEventListener('change', (e) => {
|
||||
currentTimezone = e.target.value;
|
||||
@ -923,3 +931,15 @@ function wheelNavigate(e) {
|
||||
}
|
||||
|
||||
document.addEventListener('wheel', wheelNavigate);
|
||||
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
|
||||
window.navigatePeriod = navigatePeriod;
|
||||
window.goToNow = goToNow;
|
||||
})();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user