minor fixes and tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-04-25 17:10:40 +03:00
parent 7cb1bd7c4b
commit 5342d3e7ca
2 changed files with 42 additions and 24 deletions

View File

@ -832,7 +832,7 @@ var BrowseActionsActions = actions.Actions({
showEmpty: false,
},
'browse-actions-keys': true,
'browse-actions-keys': 'on',
'browse-actions-shortcut-marker': '\\$(\\w)',
},
@ -1291,10 +1291,10 @@ var BrowseActionsActions = actions.Actions({
toggleBrowseActionKeys: ['Interface/Show keys in menu',
core.makeConfigToggler(
'browse-actions-keys',
[true, false],
['on', 'off'],
function(state){
this.modal.client.dom.hasClass('browse-actions')
&& this.modal.client.dom[state ? 'addClass' : 'removeClass']('show-keys')
&& this.modal.client.dom[state == 'on' ? 'addClass' : 'removeClass']('show-keys')
})],
})

View File

@ -1249,7 +1249,8 @@ var ConfigLocalStorageActions = actions.Actions({
}],
toggleAutoStoreConfig: ['File/Store configuration',
toggler.Toggler(null, function(_, state){
toggler.Toggler(null,
function(_, state){
if(state == null){
return this.__auto_save_config_timer || 'none'
@ -1972,11 +1973,15 @@ var ControlActions = actions.Actions({
// XXX do not do anything on viewer focus... (???)
toggleImageClickHandling: ['Interface/Image click handling',
toggler.Toggler(null,
function(){
return this.ribbons
function(_, new_state){
return new_state ?
// NOTE: we are not setting the state here, so
// nothing to do...
null
: (this.ribbons
&& this.ribbons.viewer
//&& this.ribbons.getRibbon().data('hammer') ? 'handling-click' : 'none' },
&& this.ribbons.getRibbon().hasClass('clickable') ?
&& this.ribbons.getRibbon().hasClass('clickable')) ?
'handling-click'
: 'none' },
'handling-click',
@ -2170,11 +2175,16 @@ var ControlActions = actions.Actions({
// to work semi smoothly...
toggleRibbonPanHandling: ['Interface/Ribbon pan handling',
toggler.Toggler(null,
function(){
return this.ribbons
function(_, new_state){
return new_state ?
// NOTE: we are not setting the state here, so there's
// nothing to do...
null
: (this.ribbons
&& this.ribbons.viewer
//&& this.ribbons.getRibbon().data('hammer') ? 'handling-pan' : 'none' },
&& this.ribbons.getRibbon().hasClass('draggable') ? 'handling-pan' : 'none' },
&& this.ribbons.getRibbon().hasClass('draggable')) ?
'handling-pan'
: 'none' },
'handling-pan',
function(state){
var that = this
@ -2402,10 +2412,14 @@ var ControlActions = actions.Actions({
// XXX add a "ribbonWheeling" ( ;) ) event a-la ribbonPanning...
toggleMouseWheelHandling: ['Interface/Mouse wheel handling',
toggler.Toggler(null,
function(){
return this.ribbons
function(_, new_state){
return new_state ?
// NOTE: we are not setting the state here, so there's
// nothing to do...
null
: (this.ribbons
&& this.ribbons.viewer
&& this.ribbons.viewer.hasClass('mouse-wheel-scroll') ?
&& this.ribbons.viewer.hasClass('mouse-wheel-scroll')) ?
'handling-mouse-wheel'
: 'none' },
'handling-mouse-wheel',
@ -2510,9 +2524,13 @@ var ControlActions = actions.Actions({
toggleSwipeHandling: ['Interface/Swipe handling',
toggler.Toggler(null,
function(_, state){
return this.ribbons
return state ?
null
: (this.ribbons
&& this.ribbons.viewer
&& this.ribbons.viewer.data('hammer') ? 'handling-swipes' : 'none' },
&& this.ribbons.viewer.data('hammer')) ?
'handling-swipes'
: 'none' },
'handling-swipes',
function(state){
var viewer = this.ribbons.viewer
@ -2579,7 +2597,7 @@ var ControlActions = actions.Actions({
},
toggleControlMode: ['- Interface/',
toggler.Toggler(null,
function(){ return this.config['control-mode'] },
function(_, state){ return state == null ? null : this.config['control-mode'] },
function(){ return Object.keys(this.__control_mode_handlers__ || [])
.concat(Object.keys(ControlActions.__control_mode_handlers__ || []))
.concat(['none'])