minor refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-11-17 18:10:09 +03:00
parent 4a6d7dcc56
commit 19ced24420

View File

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