added context menu help to .browseActions(..)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-09-09 19:04:34 +03:00
parent a2cd1c3557
commit e07e627351
3 changed files with 20 additions and 3 deletions

View File

@ -1781,12 +1781,14 @@ var BrowseActionsActions = actions.Actions({
&& this.dom.addClass('show-keys')
// handle '?' button to browse path...
this.showDoc = function(){
var showDoc = this.showDoc = function(){
var action = this.select('!').attr('action')
action
&& actions.showDoc(action)
}
this.keyboard.handler('General', '?', 'showDoc')
this.menu(showDoc.bind(this))
})
return dialog

View File

@ -1717,7 +1717,7 @@ var BrowserPrototype = {
return this
},
blur: widget.proxyToDom('blur'),
menu: widget.proxyToDom('menu'),
// base api...
@ -2033,6 +2033,8 @@ var BrowserPrototype = {
// // the list update.
// update: <handler>,
//
// menu: <handler>,
//
// <event>: <handler>,
// ...
// },
@ -2394,6 +2396,10 @@ var BrowserPrototype = {
.click(function(){
!$(this).hasClass('disabled')
&& that.push($(this)) })
.on('contextmenu', function(){
that.select($(this))
res.trigger('menu', txt)
})
// append text elements...
.append(p)

View File

@ -19,7 +19,16 @@ var proxyToDom =
module.proxyToDom =
function(name){
return function(){
this.dom[name].apply(this.dom, arguments)
// easy handler...
if(name in this.dom){
this.dom[name].apply(this.dom, arguments)
// trigger...
} else {
arguments[0] instanceof Function ?
this.dom.on(name, arguments[0])
: this.dom.trigger(name, [].slice.call(arguments))
}
return this
}
}