From 147a28ed27d3ae549b3fba6e2587ca45dcd1735d Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 15 Jan 2014 07:05:50 +0400 Subject: [PATCH] fixed typo and moved from CONFIG.max_screen_images to a more screen size neutral CONFIG.min_image_size... Signed-off-by: Alex A. Naanou --- ui/crop.js | 2 +- ui/data.js | 4 ++-- ui/keybindings.js | 2 +- ui/ribbons.js | 7 ++++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/crop.js b/ui/crop.js index 63170dd0..e39224b7 100755 --- a/ui/crop.js +++ b/ui/crop.js @@ -378,7 +378,7 @@ function filterImagesDialog(){ } else if(/^Flipped/.test(field) && res[field].trim() != ''){ if(res[field] == 'no'){ filter['flipped'] = 'undefined|null' - if(res[field] == 'any'){ + } else if(res[field] == 'any'){ filter['flipped'] = '.*' } else { filter['flipped'] = res[field] diff --git a/ui/data.js b/ui/data.js index 07bbf938..9195a992 100755 --- a/ui/data.js +++ b/ui/data.js @@ -124,7 +124,7 @@ var CONFIG = { zoom_step_scale: 1.2, // ribbon scaling limits and defaults... - max_screen_images: 12, + min_image_size: 100, default_screen_images: 4, // localStorage prefix... @@ -2272,7 +2272,7 @@ function reloadViewer(reuse_current_structure, images_per_screen){ var current = DATA.current // if no width is given, use the current or default... var w = images_per_screen == null ? getScreenWidthInImages() : images_per_screen - w = w > CONFIG.max_screen_images ? CONFIG.default_screen_images : w + w = w > getScreenWidthInImages(CONFIG.min_image_size) ? CONFIG.default_screen_images : w // reset data structure... if(!reuse_current_structure){ diff --git a/ui/keybindings.js b/ui/keybindings.js index 60a2a76d..1c027e1d 100755 --- a/ui/keybindings.js +++ b/ui/keybindings.js @@ -388,7 +388,7 @@ var KEYBOARD_CONFIG = { '#7': doc('Fit seven images', function(){ fitNImages(7) }), '#8': doc('Fit eight images', function(){ fitNImages(8) }), '#9': doc('Fit nine images', function(){ fitNImages(9) }), - '#0': doc('Fit maximum images', function(){ fitNImages(CONFIG.max_screen_images) }), + '#0': doc('Fit maximum images', function(){ fitNImages(getScreenWidthInImages(CONFIG.min_image_size)) }), // cropping... C: doc('Show ribbon crop dialog', cropImagesDialog), diff --git a/ui/ribbons.js b/ui/ribbons.js index ff7ac901..58ea95d6 100755 --- a/ui/ribbons.js +++ b/ui/ribbons.js @@ -21,7 +21,7 @@ **********************************************************************/ var CONFIG = { - max_screen_images: 12, + min_image_size: 100, zoom_step_scale: 1.2, } @@ -1160,9 +1160,10 @@ function zoomIn(){ } function zoomOut(){ var w = getScreenWidthInImages() - if(w <= CONFIG.max_screen_images){ + var max = getScreenWidthInImages(CONFIG.min_image_size) + if(w <= max){ w = w * CONFIG.zoom_step_scale - fitNImages(w <= CONFIG.max_screen_images ? w : CONFIG.max_screen_images) + fitNImages(w <= max ? w : max) } }