feat: add support for links in sanbox mode

This commit is contained in:
Knut Sveidqvist
2022-01-28 14:45:43 +01:00
parent e3e9c67f5b
commit fa55b7c824
8 changed files with 138 additions and 32 deletions

View File

@@ -10,6 +10,7 @@ let axisFormat = '';
let todayMarker = '';
let includes = [];
let excludes = [];
let links = {};
let title = '';
let sections = [];
let tasks = [];
@@ -44,6 +45,7 @@ export const clear = function () {
inclusiveEndDates = false;
topAxis = false;
lastOrder = 0;
links = {};
};
export const setAxisFormat = function (txt) {
@@ -101,6 +103,10 @@ export const getExcludes = function () {
return excludes;
};
export const getLinks = function () {
return links;
};
export const setTitle = function (txt) {
title = txt;
};
@@ -505,6 +511,7 @@ export const setLink = function (ids, _linkStr) {
pushFun(id, () => {
window.open(linkStr, '_self');
});
links[id] = linkStr;
}
});
setClass(ids, 'clickable');
@@ -642,6 +649,7 @@ export default {
getExcludes,
setClickEvent,
setLink,
getLinks,
bindFunctions,
durationToDate,
isInvalidDate,