Skip to content

Commit

Permalink
Fixed possible issue with newest release of Chrome (removeEventListener)
Browse files Browse the repository at this point in the history
  • Loading branch information
paopre committed Nov 18, 2021
1 parent 941f70c commit d520f82
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/webgui/js/svg-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2886,12 +2886,8 @@ function initPanZoom(active) {
function activatePanZoom() {
if (panzoomInstance != null) {
var svg = document.querySelector("svg")
if (svg.getAttribute("zoomeventlistener") == null)
{
svg.setAttribute("zoomeventlistener", "true")
svg.addEventListener('wheel', zoomWithWheel)
svg.addEventListener('dblclick', zoomWithDblClick)
}
svg.addEventListener('wheel', zoomWithWheel)
svg.addEventListener('dblclick', zoomWithDblClick)
panzoomInstance.bind()
var svgcontainer = document.getElementById("svgcontainer")
svgcontainer.style.cursor = "move"
Expand All @@ -2900,11 +2896,9 @@ function activatePanZoom() {

function deactivatePanZoom() {
if (panzoomInstance != null) {
//var svg = document.querySelector("svg")
//{
// svg.removeEventListener('wheel', zoomWithWheel)
// svg.removeEventListener('dblclick', zoomWithDblClick)
//}
var svg = document.querySelector("svg")
//svg.removeEventListener('wheel', zoomWithWheel)
//svg.removeEventListener('dblclick', zoomWithDblClick)
panzoomInstance.destroy()
var svgcontainer = document.getElementById("svgcontainer")
svgcontainer.style.cursor = "auto"
Expand Down

0 comments on commit d520f82

Please sign in to comment.