[pve-devel] [PATCH widget-toolkit 4/5] toolkit: fix #1516: mouse-scrolling of overflowhandlers in firefox

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Dec 19 08:16:14 CET 2017


this is a workaround for scrolling in toolbars, etc. in firefox with
the mouse.
while the result is not very "pretty", it maintains the old behaviour
for all other browsers and makes it work in firefox

we may drop this when we update to a new extjs release

commit 484bf3f29e58d0f96c65e6dca6b5dd95eaea180c from pve-manager

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 Toolkit.js | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Toolkit.js b/Toolkit.js
index 9e37352..e4e9dca 100644
--- a/Toolkit.js
+++ b/Toolkit.js
@@ -304,6 +304,31 @@ Ext.define('Proxmox.form.field.Text', {
     },
 });
 
+// this should be fixed with ExtJS 6.0.2
+// make mousescrolling work in firefox in the containers overflowhandler
+Ext.define(null, {
+    override: 'Ext.layout.container.boxOverflow.Scroller',
+
+    createWheelListener: function() {
+	var me = this;
+	if (Ext.isFirefox) {
+	    me.wheelListener = me.layout.innerCt.on('wheel', me.onMouseWheelFirefox, me, {destroyable: true});
+	} else {
+	    me.wheelListener = me.layout.innerCt.on('mousewheel', me.onMouseWheel, me, {destroyable: true});
+	}
+    },
+
+    // special wheel handler for firefox. differs from the default onMouseWheel
+    // handler by using deltaY instead of wheelDeltaY and no normalizing,
+    // because it is already
+    onMouseWheelFirefox: function(e) {
+	e.stopEvent();
+	var delta = e.browserEvent.deltaY || 0;
+	this.scrollBy(delta * this.wheelIncrement, false);
+    }
+
+});
+
 // force alert boxes to be rendered with an Error Icon
 // since Ext.Msg is an object and not a prototype, we need to override it
 // after the framework has been initiated
-- 
2.11.0





More information about the pve-devel mailing list