mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
feat: add support for links in sanbox mode
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user