From 68bc67aed1e33582a9e10a325938cf843edfac0a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 26 Apr 2016 02:49:06 +0300 Subject: [PATCH] ... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/keyboard.js | 6 +++--- ui (gen4)/features/ui-single-image.js | 14 +++++--------- ui (gen4)/features/ui.js | 7 +++---- ui (gen4)/ribbons.js | 10 ++++------ 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/ui (gen4)/features/keyboard.js b/ui (gen4)/features/keyboard.js index cdf8793c..5aa26a54 100755 --- a/ui (gen4)/features/keyboard.js +++ b/ui (gen4)/features/keyboard.js @@ -72,9 +72,9 @@ module.GLOBAL_KEYBOARD = { // XXX use a means to scale that does not get affected by image // proportions... - '#1': 'fitImage: 1 -- Fit image to screen', - '#2': 'fitImage: 2 -- Show image with frame', - '#3': 'fitImage: 5 -- Show small image', + '#1': 'fitScreen', + '#2': 'fitNormal', + '#3': 'fitSmall', Esc: 'toggleSingleImage: "off" -- Exit single image view', }, diff --git a/ui (gen4)/features/ui-single-image.js b/ui (gen4)/features/ui-single-image.js index dffe5658..11376c36 100755 --- a/ui (gen4)/features/ui-single-image.js +++ b/ui (gen4)/features/ui-single-image.js @@ -72,15 +72,11 @@ var core = require('features/core') // . . // + - - - - - - - - - + // -// XXX might be a good idea to use tiles for zoomed in images... // +// NOTE: this in part does the same job as .ribbons.correctImageProportionsForRotation(..) +// +// XXX might be a good idea to use tiles for zoomed in images... // XXX should this be an action??? -// XXX alignment issues in rotated images... -// ...this makes .ribbons.centerImage() / .ribbons.centerRibbon() -// do things incorreclty in single image mode... -// NOTE: they do their job correctly on rectangular images in -// ribbon view! -// XXX this makes exiting single image mode align image incorrectly... function updateImageProportions(){ var that = this var threshold = this.config['single-image-proportions-threshold'] @@ -297,6 +293,7 @@ module.SingleImageView = core.ImageGridFeatures.Feature({ .each(function(_, img){ img.style.width = '' img.style.height = '' + img.style.margin = '' }) @@ -335,12 +332,11 @@ module.SingleImageViewLocalStorage = core.ImageGridFeatures.Feature({ return } - console.log('!!!!!!!!!!!!!!', this.config['ribbon-scale']) - if(this.toggleSingleImage('?') == 'on'){ this.scale = this.config['single-image-scale'] || this.scale } else { + // XXX for some reason this stopped working... this.scale = this.config['ribbon-scale'] || this.scale } }], diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index 20807e95..7397cb21 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -577,7 +577,6 @@ module.ViewerActions = actions.Actions({ // ...this is done to add ability to control scroll indication. // // XXX make these neutral to screen and image proportions... - // ...use .scale instead of .screenwidth??? fitImage: ['Zoom/Fit image', function(count, overflow){ if(count != null){ @@ -598,11 +597,11 @@ module.ViewerActions = actions.Actions({ // similar across platforms... // ...for this we need to get display dpi... fitSmall: ['Zoom/Show small image', - function(){ }], + function(){ this.fitImage(5, 0) }], fitNormal: ['Zoom/Show normal image', - function(){ }], + function(){ this.fitImage(1.5, 0) }], fitScreen: ['Zoom/Fit image to screen', - function(){ }], + function(){ this.fitImage(1, 0) }], fitRibbon: ['Zoom/Fit ribbon vertically', diff --git a/ui (gen4)/ribbons.js b/ui (gen4)/ribbons.js index 29a8b665..2acdc035 100755 --- a/ui (gen4)/ribbons.js +++ b/ui (gen4)/ribbons.js @@ -2191,18 +2191,16 @@ var RibbonsPrototype = { image.css({ width: h, height: w, - }) - image.css({ - 'margin': -((w - h)/2) +'px '+ (w - h)/2 + 'px' + + margin: -((w - h)/2) +'px '+ (w - h)/2 + 'px' }) } else if((o == 0 || o == 180) && image_p != viewer_p){ image.css({ width: h, height: w, - }) - image.css({ - 'margin': '', + + margin: '', }) }