From 19ced2442086981d3b097c15a64f5453fbe3dbcc Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 17 Nov 2014 18:10:09 +0300 Subject: [PATCH] minor refactoring... Signed-off-by: Alex A. Naanou --- ui (gen4)/viewer.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index a43b03a2..7232b588 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -219,6 +219,8 @@ actions.Actions({ // XXX is this the correct way to go??? // ...can we save simple attribute values??? dump: ['Dump state as JSOM object', + 'This will collect JSON data from every afailable attribute ' + +'supporting the .dumpJSON() method.', function(){ var res = {} for(var k in this){ @@ -550,8 +552,8 @@ var Viewer = module.Viewer = actions.Actions(Client, { - // Images... /* + // Images... get images(){ return this.ribbons != null ? this.ribbons.images : null }, @@ -654,7 +656,7 @@ actions.Actions(Client, { } }], - toggleTheme: ['', + toggleTheme: ['Toggle viewer theme', CSSClassToggler( function(){ return this.ribbons.viewer }, [ @@ -812,13 +814,17 @@ actions.Actions(Client, { this.ribbons.setBaseRibbon(r) }], + // NOTE: these prioritize whole images, i.e. each image will at least + // once be fully shown. prevScreen: ['Focus previous image one screen width away', function(){ - this.prevImage(Math.round(this.ribbons.getScreenWidthImages())) + // NOTE: the 0.2 is added to compensate for alignment/scaling + // errors -- 2.99 images wide counts as 3 while 2.5 as 2. + this.prevImage(Math.floor(this.ribbons.getScreenWidthImages() + 0.2)) }], nextScreen: ['Focus next image one screen width away', function(){ - this.nextImage(Math.round(this.ribbons.getScreenWidthImages())) + this.nextImage(Math.floor(this.ribbons.getScreenWidthImages() + 0.2)) }], // zooming... @@ -1050,7 +1056,8 @@ function Feature(feature_set, obj){ return obj } - +Feature.prototype = FeatureProto +Feature.prototype.constructor = Feature // XXX experimental...