diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-11 16:28:49 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-11 16:28:49 +0100 |
commit | 93c40e8eeaef8e1609759fb1f0cad1fc9285ab86 (patch) | |
tree | 0bec8403bddefbb4b0f9785765ce61ffbfba4106 /static/script.ts | |
parent | Add madge for frontend dep visualization. (diff) | |
download | calp-93c40e8eeaef8e1609759fb1f0cad1fc9285ab86.tar.gz calp-93c40e8eeaef8e1609759fb1f0cad1fc9285ab86.tar.xz |
Made VIEW and EDIT_MODE correctly global.
Diffstat (limited to '')
-rw-r--r-- | static/script.ts | 9 |
1 files changed, 7 insertions, 2 deletions
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; |