some tweaking + docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-05-31 17:28:46 +03:00
parent 10435aa078
commit 65eaddb321
3 changed files with 26 additions and 1 deletions

View File

@ -487,6 +487,11 @@ var IntrospectionActions = actions.Actions({
return !!action.__event__ }),
// XXX revise...
// XXX this is a bit restrictive, need to be able to setup mode
// aliases/handlers, i.e. setting {mode: 'advanced'} and either
// getting the actual value from .config or calling a mode handler...
// ...might also be nice to use a toggler as handler:
// {mode: 'toggleBrowseAdvanced'}
getActionMode: ['- Interface/',
doc`Get action browse mode...

View File

@ -352,6 +352,7 @@ var LocationActions = actions.Actions({
core.doc`Toggle index synchronization method
NOTE: this will not show disabled methods.`,
{mode: 'toggleBrowseActionKeys'},
toggler.Toggler(null,
function(_, state){
var dict = this.location_sync_methods

View File

@ -2932,7 +2932,7 @@ var BrowseActionsActions = actions.Actions({
actions.config['browse-actions-keys']
&& this.dom.addClass('show-keys')
// handle '?' button to browse path...
// handle '?' -- show doc...
var showDoc = this.showDoc = function(){
var action = this.select('!').attr('action')
action
@ -2940,9 +2940,28 @@ var BrowseActionsActions = actions.Actions({
}
this.keyboard.handler('General', '?', 'showDoc')
this.menu(showDoc.bind(this))
// handle ctrl-a -- toggle advanced mode...
var toggleAdvanced = this.toggleAdvanced = function(){
actions.toggleBrowseAdvanced()
this.update()
}
this.keyboard.handler('General', 'ctrl-a', 'toggleAdvanced')
}) })],
toggleBrowseAdvanced: ['System|Interface/-99: Advanced menu items',
core.doc`Toggle advanced menu items...
An item can:
- define a .mode() mothod
- check .config['browse-advanced-mode'] to be 'on' / 'off'
- return 'hidden' when needed
or:
- link to an action that behaves in a desired way:
{mode: 'toggleBrowseActionKeys',}
See .toggleBrowseActionKeys(..) for an example.
`,
core.makeConfigToggler(
'browse-advanced-mode',
['off', 'on'])],