From 93c40e8eeaef8e1609759fb1f0cad1fc9285ab86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 11 Nov 2021 16:28:49 +0100 Subject: Made VIEW and EDIT_MODE correctly global. --- static/script.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'static/script.ts') diff --git a/static/script.ts b/static/script.ts index b9336165..655d1e36 100644 --- a/static/script.ts +++ b/static/script.ts @@ -2,7 +2,7 @@ import { close_all_popups } from './popup' import { VEvent, xml_to_vcal } from './vevent' import { SmallcalCellHighlight, Timebar } from './clock' import { makeElement } from './lib' -import { vcal_objects, event_calendar_mapping, EDIT_MODE } from './globals' +import { vcal_objects, event_calendar_mapping } from './globals' import { open_popup } from './popup' import { EventCreator } from './event-creator' import { PopupElement } from './components/popup-element' @@ -14,6 +14,11 @@ import { initialize_components } from './elements' window.addEventListener('load', function() { + /* + TODO possibly check here that both window.EDIT_MODE and window.VIEW have + defined values. + */ + // let json_objects_el = document.getElementById('json-objects'); let div = document.getElementById('xcal-data')!; let vevents = div.firstElementChild!.children; @@ -72,7 +77,7 @@ window.addEventListener('load', function() { }, 1000 * 60); /* Is event creation active? */ - if (true && EDIT_MODE) { + if (true && window.EDIT_MODE) { let eventCreator = new EventCreator; for (let c of document.getElementsByClassName("events")) { if (!(c instanceof HTMLElement)) continue; -- cgit v1.2.3