From f3d7472cd4e895d93db9c22b52b618a1f7641a8f Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 3 Jan 2019 01:53:10 +0300 Subject: [PATCH] minor tweaking... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index ded865a9..f3017799 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -133,6 +133,8 @@ module.ViewerActions = actions.Actions({ config: { // make the direction steps depend on screen size... 'steps-to-change-direction': 'screenwidth', + 'steps-to-change-direction-min': 2, + 'steps-to-change-direction-max': 6, // The maximum screen width allowed when zooming... 'max-screen-images': 30, @@ -324,12 +326,12 @@ module.ViewerActions = actions.Actions({ // XXX EXPERIMENTAL: direction... get direction_change_steps(){ - var steps = this.config['steps-to-change-direction'] - return steps == 'screenwidth' ? - Math.ceil(this.screenwidth / 2) - : typeof(steps) == typeof(123) ? + var steps = this.config['steps-to-change-direction'] + var min = this.config['steps-to-change-direction-min'] || 3 + var max = this.config['steps-to-change-direction-max'] || 6 + return typeof(steps) == typeof(123) ? steps - : Math.ceil(this.screenwidth / 2) }, + : Math.min(Math.max(Math.ceil(this.screenwidth / 2), min), max) }, // Navigation...