fixes and cleanup....

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-01-11 23:48:36 +03:00
parent 0a71d011f5
commit e8950cebe8
2 changed files with 12 additions and 14 deletions

View File

@ -922,8 +922,7 @@ var ExampleUIActions = actions.Actions({
widgets.makeUIDialog(function(spec, callback){
var that = this
var d0 = {}
var d1 = {}
var d2 = {}
var b1, b2
return browse.makeLister(null, function(path, make){
make([
@ -941,22 +940,20 @@ var ExampleUIActions = actions.Actions({
//make.field.Toggle('Toggle: ', 'on')
make.field.Toggle('Toggle: ', d0)
// XXX test callback...
make.batch([
make.batch(b1 = b1 || [
'---',
[['X', 'Y']],
{title: 'foo', value: 123},
Object.assign(d1,
{type: 'field.Toggle', title: 'Batch toggle 1: '}),
{type: 'field.Toggle', title: 'Batch toggle 1: '},
])
// XXX test callback...
make.field.batch([
make.field.batch(b2 = b2 || [
'---',
['X', 'Y'],
{title: 'foo', value: 123},
Object.assign(d2,
{type: 'Toggle', title: 'Batch toggle 2: '}),
])
{type: 'Toggle', title: 'foo', values: ['1','2','3'], list: false},
{type: 'Toggle', title: 'Batch toggle 2: '},
], function(){
console.log('---', ...arguments)
})
}, {
cls: 'table-view',

View File

@ -1045,6 +1045,7 @@ browse.items.makeSubContext = function(name, obj){
// ...this can be problematic as the wrapper is external to the browser...
// - as a sub-path...
// ...this is hard without side-effects...
// XXX need to make this handle updates correctly...
browse.items.makeSubContext('field',
function(title, value, options){
// parse arguments...
@ -1086,6 +1087,7 @@ browse.items.makeSubContext('field',
// - a way to define defaults -- global options?
// - access to the .app -- should be configurable...
// - default methods .showEditableList(..) / .showList(..) on make(..)
// XXX need to make this handle updates correctly...
browse.items.field.Toggle =
function(title, options){
var that = this
@ -1102,8 +1104,6 @@ function(title, options){
Object.assign(
options,
{
type: 'toggle',
open: function(evt){
// XXX CONTEXT...
var actions = options.app || that.app
@ -1221,6 +1221,7 @@ function(title, options){
// XXX should this also take batch options???
// XXX need to make this handle updates correctly...
browse.items.batch =
function(spec, callback){
var that = this