tweaks and fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-12-08 02:45:33 +03:00
parent 0ead526ea9
commit 0ffcda0e4e
2 changed files with 21 additions and 8 deletions

View File

@ -921,6 +921,7 @@ var ExampleUIActions = actions.Actions({
exampleEditor2: ['Test/Universal Editor (2)...', exampleEditor2: ['Test/Universal Editor (2)...',
widgets.makeUIDialog(function(spec, callback){ widgets.makeUIDialog(function(spec, callback){
var that = this var that = this
var data = {}
return browse.makeLister(null, function(path, make){ return browse.makeLister(null, function(path, make){
make([ make([
@ -934,11 +935,9 @@ var ExampleUIActions = actions.Actions({
return that.features.features.length }) return that.features.features.length })
make.field('A', 'B') make.field('A', 'B')
//make.field.field('C', 'D')
//make.field.field.field('E', 'F')
make.field.field.field.field('G', 'H')
make.field.Toggle('Toggle', 'on') //make.field.Toggle('Toggle: ', 'on')
make.field.Toggle('Toggle: ', data)
}, { }, {
cls: 'table-view', cls: 'table-view',

View File

@ -658,8 +658,7 @@ var DialogsActions = actions.Actions({
.last() .last()
return modal.data('widget-controller') return modal.data('widget-controller')
|| (modal.length > 0 && modal) || (modal.length > 0 && modal)
|| null || null },
},
// testers... // testers...
// //
@ -1059,13 +1058,28 @@ browse.items.makeSubContext('field',
//
// .field.Toggle(title, value)
// .field.Toggle(title, options)
// .field.Toggle(title, value, options)
//
// XXX need to open a list dialog (currently context is used)... // XXX need to open a list dialog (currently context is used)...
// ...this can be set via options.list but would be nice to provide // ...this can be set via options.list but would be nice to provide
// a reasonable default... // a reasonable default...
// ...one way to resole context access is to add a .app attribute to
// the dialog...
browse.items.field.Toggle = browse.items.field.Toggle =
function(title, value, options){ function(title, options){
var that = this var that = this
options = options || {} // parse args...
var args = [...arguments].slice(1)
var value = args[0] instanceof Object ?
(args[0].value
|| (args[0].values || [])[0]
|| 'off')
: args.shift()
options = args.shift() || {}
return this.field(title, value, return this.field(title, value,
Object.assign( Object.assign(
options, options,