mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
tweaking .direction
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
74f83dd637
commit
c0ca5bc13e
@ -150,7 +150,7 @@ actions.Actions({
|
|||||||
|| 'right'
|
|| 'right'
|
||||||
: value
|
: value
|
||||||
|
|
||||||
var steps = this.config['steps-to-change-direction']
|
var steps = this.direction_change_steps
|
||||||
var direction = this.__direction || new Array(steps)
|
var direction = this.__direction || new Array(steps)
|
||||||
|
|
||||||
// value ends with '!' -> force direction change...
|
// value ends with '!' -> force direction change...
|
||||||
@ -179,6 +179,12 @@ actions.Actions({
|
|||||||
// step in the opposite direction...
|
// step in the opposite direction...
|
||||||
: direction.slice(0, -1)
|
: direction.slice(0, -1)
|
||||||
},
|
},
|
||||||
|
// NOTE: these are set-up as props to enable dynamic customization...
|
||||||
|
// XXX not sure this is a good way to go...
|
||||||
|
get direction_change_steps(){
|
||||||
|
return this.config['steps-to-change-direction'] },
|
||||||
|
set direction_change_steps(value){
|
||||||
|
this.config['steps-to-change-direction'] = value },
|
||||||
|
|
||||||
|
|
||||||
// Consistency checking...
|
// Consistency checking...
|
||||||
|
|||||||
@ -131,6 +131,9 @@ var base = require('features/base')
|
|||||||
var ViewerActions =
|
var ViewerActions =
|
||||||
module.ViewerActions = actions.Actions({
|
module.ViewerActions = actions.Actions({
|
||||||
config: {
|
config: {
|
||||||
|
// make the direction steps depend on screen size...
|
||||||
|
'steps-to-change-direction': 'screenwidth',
|
||||||
|
|
||||||
// The maximum screen width allowed when zooming...
|
// The maximum screen width allowed when zooming...
|
||||||
'max-screen-images': 30,
|
'max-screen-images': 30,
|
||||||
|
|
||||||
@ -319,6 +322,15 @@ module.ViewerActions = actions.Actions({
|
|||||||
'ribbon-image-separators',
|
'ribbon-image-separators',
|
||||||
function(state){ this.config['ribbon-image-separators'] = state }) ],
|
function(state){ this.config['ribbon-image-separators'] = state }) ],
|
||||||
|
|
||||||
|
// XXX EXPERIMENTAL: direction...
|
||||||
|
get direction_change_steps(){
|
||||||
|
var steps = this.config['steps-to-change-direction']
|
||||||
|
return steps == 'screenwidth' ?
|
||||||
|
Math.ceil(this.screenwidth / 2)
|
||||||
|
: typeof(steps) == typeof(123) ?
|
||||||
|
steps
|
||||||
|
: Math.ceil(this.screenwidth / 2) },
|
||||||
|
|
||||||
|
|
||||||
// Navigation...
|
// Navigation...
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user