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 <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-01-15 07:05:50 +04:00
parent bc91949196
commit 147a28ed27
4 changed files with 8 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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