some refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-16 18:06:42 +03:00
parent a15397c1af
commit 261a8690f4
2 changed files with 19 additions and 4 deletions

View File

@ -1198,6 +1198,8 @@ var FileSystemWriterUIActions = actions.Actions({
'export-preview-size')) 'export-preview-size'))
}, },
// XXX make this editable on open and remove "new" from history...
// XXX add "history" button...
'target_dir': function(actions, make, overlay){ 'target_dir': function(actions, make, overlay){
return make(['To: ', return make(['To: ',
function(){ return actions.config['export-path'] || './' }], function(){ return actions.config['export-path'] || './' }],
@ -1219,8 +1221,17 @@ var FileSystemWriterUIActions = actions.Actions({
// XXX ugly... // XXX ugly...
overlay.focus() overlay.focus()
}) })
}] }],
['histroy', widgets.makeNestedConfigListEditor(actions, overlay,
'export-paths',
'export-path',
{
new_button: false,
// XXX add 'edit' button...
//itemButtons: []
})],
]}) ]})
// XXX make this editable???
.on('open', .on('open',
widgets.makeNestedConfigListEditor(actions, overlay, widgets.makeNestedConfigListEditor(actions, overlay,
'export-paths', 'export-paths',

View File

@ -114,15 +114,19 @@ function(actions, list_key, options){
.push(txt) .push(txt)
// unique... // unique...
if(options.unique){ if(options.unique == null || options.unique){
actions.config[list_key] = actions.config[list_key] actions.config[list_key] = actions.config[list_key]
.unique(options.unique !== true ? options.unique : undefined) .unique(typeof(options.unique) == typeof(function(){}) ?
options.unique
: undefined)
} }
// sort... // sort...
if(options.sort){ if(options.sort){
actions.config[list_key] = actions.config[list_key] actions.config[list_key] = actions.config[list_key]
.sort(options.sort !== true ? options.sort : undefined) .sort(typeof(options.sort) == typeof(function(){}) ?
options.sort
: undefined)
} }
// update the list data... // update the list data...