From b7d39140b0f0fea6d5510cced41c6bd5486a44e8 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Tue, 22 Nov 2016 09:02:43 +0100 Subject: [PATCH] Increases scrolling steps and adds scrolling animations to the tab bar. #424 --- .../layout/container/boxOverflow/Scroller.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 overrides/layout/container/boxOverflow/Scroller.js diff --git a/overrides/layout/container/boxOverflow/Scroller.js b/overrides/layout/container/boxOverflow/Scroller.js new file mode 100644 index 00000000..69682125 --- /dev/null +++ b/overrides/layout/container/boxOverflow/Scroller.js @@ -0,0 +1,34 @@ +/** + * Per default scrolling the tab bar moves the tabs 20 pixels. + * To improve the usability of the tab bar this value is increased for Rambox. + * Also animations are enabled, so the user understands what's going on. + */ +Ext.define('Rambox.overrides.layout.container.boxOverflow.Scroller', { + override: 'Ext.layout.container.boxOverflow.Scroller', + + scrollIncrement: 250, + wheelIncrement: 50, + + animateScroll: true, + scrollDuration: 250, + + /** + * In difference to the overridden function this one enables scroll animations. + * + * @private + * Scrolls to the left by the configured amount + */ + scrollLeft: function() { + this.scrollBy(-this.scrollIncrement); + }, + + /** + * In difference to the overridden function this one enables scroll animations. + * + * @private + * Scrolls to the right by the configured amount + */ + scrollRight: function() { + this.scrollBy(this.scrollIncrement); + } +});