Page MenuHomePhabricator

ol212-mwheel-passive.diff

Authored By
Nux
Jul 4 2021, 11:11 AM
Size
1 KB
Referenced Files
None
Subscribers
None

ol212-mwheel-passive.diff

OpenLayers.js | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/OpenLayers.js b/OpenLayers.js
index 9626e1c..7276c50 100644
--- a/OpenLayers.js
+++ b/OpenLayers.js
@@ -12271,9 +12271,13 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
activate: function (a) {
if (OpenLayers.Handler.prototype.activate.apply(this, arguments)) {
var b = this.wheelListener;
- OpenLayers.Event.observe(window, "DOMMouseScroll", b);
- OpenLayers.Event.observe(window, "mousewheel", b);
- OpenLayers.Event.observe(document, "mousewheel", b);
+ var opt = {passive: false};
+ // OpenLayers.Event.observe(window, "DOMMouseScroll", b);
+ // OpenLayers.Event.observe(window, "mousewheel", b);
+ // OpenLayers.Event.observe(document, "mousewheel", b);
+ window.addEventListener("DOMMouseScroll", b, opt);
+ window.addEventListener("mousewheel", b, opt);
+ document.addEventListener("mousewheel", b, opt);
return !0
}
return !1
@@ -12281,10 +12285,12 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
deactivate: function (a) {
if (OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
var b = this.wheelListener;
- OpenLayers.Event.stopObserving(window, "DOMMouseScroll", b);
- OpenLayers.Event.stopObserving(window, "mousewheel",
- b);
- OpenLayers.Event.stopObserving(document, "mousewheel", b);
+ // OpenLayers.Event.stopObserving(window, "DOMMouseScroll", b);
+ // OpenLayers.Event.stopObserving(window, "mousewheel", b);
+ // OpenLayers.Event.stopObserving(document, "mousewheel", b);
+ window.removeEventListener("DOMMouseScroll", b);
+ window.removeEventListener("mousewheel", b);
+ document.removeEventListener("mousewheel", b);
return !0
}
return !1

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9118550
Default Alt Text
ol212-mwheel-passive.diff (1 KB)

Event Timeline