some minor stuff and fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-18 03:05:48 +03:00
parent 74924936ba
commit 573ce76333
2 changed files with 21 additions and 14 deletions

View File

@ -593,11 +593,11 @@ var FileSystemWriterActions = actions.Actions({
// - horizontal // - horizontal
// - ... // - ...
'export-preview-sizes': [ 'export-preview-sizes': [
500, '500',
900, '900',
1000, '1000',
1280, '1280',
1920, '1920',
], ],
}, },
@ -949,7 +949,7 @@ var FileSystemWriterActions = actions.Actions({
// get best preview... // get best preview...
var from = (img.base_path || base_dir) +'/'+ that.images.getBestPreview(gid, size).url var from = decodeURI((img.base_path || base_dir) +'/'+ that.images.getBestPreview(gid, size).url)
// XXX see if we need to make a preview (sharp) // XXX see if we need to make a preview (sharp)
// XXX // XXX
@ -1245,7 +1245,10 @@ var FileSystemWriterUIActions = actions.Actions({
.on('open', .on('open',
widgets.makeNestedConfigListEditor(actions, overlay, widgets.makeNestedConfigListEditor(actions, overlay,
'export-preview-sizes', 'export-preview-sizes',
'export-preview-size')) 'export-preview-size',
{
sort: function(a, b){ return parseInt(a) - parseInt(b) },
}))
}, },
// XXX BUG: history closing errors -- non-critical... // XXX BUG: history closing errors -- non-critical...
@ -1276,7 +1279,6 @@ var FileSystemWriterUIActions = actions.Actions({
'export-paths', 'export-paths',
'export-path', 'export-path',
{ {
unique: true,
new_button: false, new_button: false,
})], })],
]}) ]})
@ -1293,7 +1295,8 @@ var FileSystemWriterUIActions = actions.Actions({
}) })
.on('edit-done', function(_, path){ .on('edit-done', function(_, path){
actions.config['export-path'] = path actions.config['export-path'] = path
actions.config['export-paths'].splice(0, 0, path) actions.config['export-paths'].indexOf(path) < 0
&& actions.config['export-paths'].splice(0, 0, path)
}) })
.on('edit-aborted edit-done', function(evt, path){ .on('edit-aborted edit-done', function(evt, path){

View File

@ -125,11 +125,14 @@ function(actions, list_key, options){
.push(txt) .push(txt)
// unique... // unique...
if(options.unique == null || options.unique){ if(options.unique == null || options.unique === true){
actions.config[list_key] = actions.config[list_key] actions.config[list_key] = actions.config[list_key]
.unique(typeof(options.unique) == typeof(function(){}) ? .unique()
options.unique
: undefined) // unique normalized...
} else if( typeof(options.unique) == typeof(function(){})){
actions.config[list_key] = actions.config[list_key]
.unique(options.unique)
} }
// sort... // sort...
@ -235,10 +238,11 @@ function(actions, list_key, options){
var makeNestedConfigListEditor = var makeNestedConfigListEditor =
module.makeNestedConfigListEditor = module.makeNestedConfigListEditor =
function(actions, parent, list_key, value_key, options){ function(actions, parent, list_key, value_key, options){
options = options || {}
return function(){ return function(){
var txt = $(this).find('.text').first().text() var txt = $(this).find('.text').first().text()
options = options || {}
var dfl_options = { var dfl_options = {
new_button: 'New...', new_button: 'New...',
length_limit: 10, length_limit: 10,