From: Thomas Lamprecht Date: Tue, 19 Dec 2017 07:16:14 +0000 (+0100) Subject: toolkit: fix #1516: mouse-scrolling of overflowhandlers in firefox X-Git-Url: https://git.proxmox.com/?p=proxmox-widget-toolkit.git;a=commitdiff_plain;h=1fb41f2e363d3e07bb7fd85c2f0925cc102775e8 toolkit: fix #1516: mouse-scrolling of overflowhandlers in firefox 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 --- 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