minor tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-10-25 16:39:43 +03:00
parent 098715bbae
commit adf094cbec

View File

@ -98,6 +98,7 @@ module.SortActions = actions.Actions({
Expand one specific method... Expand one specific method...
.expandSortMethod(method) .expandSortMethod(method)
-> [method, ..] -> [method, ..]
-> null
Expand specific methods... Expand specific methods...
.expandSortMethod(method, method, ..) .expandSortMethod(method, method, ..)
@ -146,7 +147,8 @@ module.SortActions = actions.Actions({
// return a single method... // return a single method...
if(!(methods instanceof Array)){ if(!(methods instanceof Array)){
return get(methods) // XXX can we return a function from an action???
return get(methods) || null
} }
// return multiple methods... // return multiple methods...
@ -725,6 +727,7 @@ var SortUIActions = actions.Actions({
// XXX do a better action calling scheme... // XXX do a better action calling scheme...
showSortMethodDoc: ['- Sort/', showSortMethodDoc: ['- Sort/',
widgets.makeUIDialog(function(method){ widgets.makeUIDialog(function(method){
var that = this
var data = this.expandSortMethod(method) var data = this.expandSortMethod(method)
return $('<div class="help-dialog">') return $('<div class="help-dialog">')
@ -739,7 +742,9 @@ var SortUIActions = actions.Actions({
'Sort order:\n ' 'Sort order:\n '
+data +data
.map(function(m){ .map(function(m){
return `<a href="javascript:ig.showSortMethodDoc('${m}')">${m}</a>`}) return that.expandSortMethod(m) ?
`<a href="javascript:ig.showSortMethodDoc('${m}')">${m}</a>`
: m })
.join('\n ')))) .join('\n '))))
})], })],