Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F34538384
ol212-mwheel-passive.diff
Nux (Maciej Jaros)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Nux
Jul 4 2021, 11:11 AM
2021-07-04 11:11:07 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
ol212-mwheel-passive.diff
View Options
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
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9118550
Default Alt Text
ol212-mwheel-passive.diff (1 KB)
Attached To
Mode
T286136: Prevent mouse wheel scrolling of maps
Attached
Detach File
Event Timeline
Log In to Comment