[pve-devel] [PATCH manager] fix #1516: fix mouse-scrolling of overflowhandlers in firefox

Dominik Csapak d.csapak at proxmox.com
Wed Oct 4 10:04:27 CEST 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 can drop this when we update to a new extjs release

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
i would really wish sencha would release a new extjs version soon
under the gpl, but it looks like the next gpl release will be 7.0
which is not even officially announced afaics
 www/manager6/Toolkit.js | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/www/manager6/Toolkit.js b/www/manager6/Toolkit.js
index ec25e7cd..56b06686 100644
--- a/www/manager6/Toolkit.js
+++ b/www/manager6/Toolkit.js
@@ -286,6 +286,33 @@ Ext.define('PVE.Datepicker', {
     hideMode: 'visibility'
 });
 
+// this should be fixed with ExtJS 6.0.2
+// this makes mousescrolling work in firefox in the overflowhandler
+// and does not change behaviour in any other browser
+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
+    // nearly the same as the default onMouseWheel handler,
+    // but using deltaY instead of wheelDeltaY
+    // and no normalizing, because it is already normalized
+    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