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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2017-12-19 08:16:14 +01:00 committed by Dominik Csapak
parent 47d1c80c37
commit 1fb41f2e36

View File

@ -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