Skip to content

Commit

Permalink
fix: pass context to eventHelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
ozyx committed May 2, 2024
1 parent dc77e35 commit 7df3d66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/plugins/imagery/lib/eventHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const helperFunctions = {
} else if (object.addEventListener) {
object.addEventListener(event, listener._cb);
} else {
object.on(event, listener._cb);
object.on(event, listener._cb, listener.context);
}

this._listeningTo.push(listener);
Expand Down Expand Up @@ -78,7 +78,7 @@ const helperFunctions = {
} else if (listener.object.removeEventListener) {
listener.object.removeEventListener(listener.event, listener._cb);
} else {
listener.object.off(listener.event, listener._cb);
listener.object.off(listener.event, listener._cb, listener.context);
}

return listener;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plot/lib/eventHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const helperFunctions = {
} else if (listener.object.removeEventListener) {
listener.object.removeEventListener(listener.event, listener._cb);
} else {
listener.object.off(listener.event, listener._cb);
listener.object.off(listener.event, listener._cb, listener.context);
}

return listener;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/summaryWidget/src/eventHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const helperFunctions = {
} else if (object.addEventListener) {
object.addEventListener(event, listener._cb);
} else {
object.on(event, listener._cb);
object.on(event, listener._cb, listener.context);
}

this._listeningTo.push(listener);
Expand Down Expand Up @@ -78,7 +78,7 @@ const helperFunctions = {
} else if (listener.object.removeEventListener) {
listener.object.removeEventListener(listener.event, listener._cb);
} else {
listener.object.off(listener.event, listener._cb);
listener.object.off(listener.event, listener._cb, listener.context);
}

return listener;
Expand Down

0 comments on commit 7df3d66

Please sign in to comment.