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') && this.dom.addClass('show-keys')
// handle '?' button to browse path... // handle '?' button to browse path...
this.showDoc = function(){ var showDoc = this.showDoc = function(){
var action = this.select('!').attr('action') var action = this.select('!').attr('action')
action action
&& actions.showDoc(action) && actions.showDoc(action)
} }
this.keyboard.handler('General', '?', 'showDoc') this.keyboard.handler('General', '?', 'showDoc')
this.menu(showDoc.bind(this))
}) })
return dialog return dialog

View File

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

View File

@ -19,7 +19,16 @@ var proxyToDom =
module.proxyToDom = module.proxyToDom =
function(name){ function(name){
return function(){ return function(){
// easy handler...
if(name in this.dom){
this.dom[name].apply(this.dom, arguments) 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 return this
} }
} }