mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 23:39:50 +02:00
#731 Issue with clicks in flowcharts. Replacing d3 with document.querySelect and addEventListener
This commit is contained in:
@@ -195,11 +195,11 @@ const setClickFun = function (id, functionName) {
|
|||||||
}
|
}
|
||||||
if (typeof vertices[id] !== 'undefined') {
|
if (typeof vertices[id] !== 'undefined') {
|
||||||
funs.push(function (element) {
|
funs.push(function (element) {
|
||||||
const elem = d3.select(element).select(`[id="${id}"]`)
|
const elem = document.querySelector(`[id="${id}"]`)
|
||||||
if (elem !== null) {
|
if (elem !== null) {
|
||||||
elem.on('click', function () {
|
elem.addEventListener("click", function(){
|
||||||
window[functionName](id)
|
window[functionName](id);
|
||||||
})
|
}, false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user