mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
fixed bug in make.EditableList(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a12f3b5c81
commit
186a45140a
@ -129,6 +129,8 @@ var UIAliasActions = actions.Actions({
|
||||
|
||||
var names = Object.keys(aliases)
|
||||
|
||||
console.log('>>>>>>>>>>>', names)
|
||||
|
||||
names.length > 0 ?
|
||||
// XXX for some reason this does not get updated on dialog.update()
|
||||
make.EditableList(names,
|
||||
@ -143,6 +145,7 @@ var UIAliasActions = actions.Actions({
|
||||
},
|
||||
|
||||
each: function(name, elem){
|
||||
console.log('>>>>', name)
|
||||
$(elem)
|
||||
.attr({
|
||||
keys: getKeys(name),
|
||||
|
||||
@ -457,6 +457,8 @@ function(data, options){
|
||||
: options.isItemHidden,
|
||||
}
|
||||
|
||||
console.log('LIST:', keys)
|
||||
|
||||
keys.forEach(function(k){
|
||||
var txt
|
||||
var opts = Object.create(options)
|
||||
@ -502,7 +504,7 @@ function(data, options){
|
||||
&& elem.on('open', data[k])
|
||||
|
||||
opts.each
|
||||
&& opts.each(txt || k, elem)
|
||||
&& opts.each.call(elem, txt || k)
|
||||
|
||||
res.push(elem[0])
|
||||
})
|
||||
@ -673,8 +675,8 @@ function(list, options){
|
||||
var make = this
|
||||
var dialog = make.dialog
|
||||
|
||||
// write back the list...
|
||||
var write = function(list, lst){
|
||||
// write back the list...
|
||||
return (list instanceof Function ?
|
||||
// call the writer...
|
||||
list(lst)
|
||||
@ -710,22 +712,24 @@ function(list, options){
|
||||
}
|
||||
options = opts
|
||||
|
||||
/*
|
||||
if(id in dialog.__list && id in dialog.__editable){
|
||||
var lst = dialog.__list[id]
|
||||
var editable = dialog.__editable[id]
|
||||
|
||||
} else {
|
||||
//*/
|
||||
var lst = list instanceof Function ?
|
||||
list()
|
||||
: list
|
||||
var editable = dialog.__editable[id] = lst instanceof Array
|
||||
var editable = dialog.__editable[id] = lst instanceof Array && dialog.__editable[id]
|
||||
// view objects...
|
||||
// NOTE: we .slice() here to make the changes a bit better packaged
|
||||
// or discrete and not done as they come in...
|
||||
lst = !editable ? Object.keys(lst) : lst.slice()
|
||||
lst = lst instanceof Array ? lst.slice() : Object.keys(lst)
|
||||
|
||||
dialog.__list[id] = lst
|
||||
}
|
||||
//}
|
||||
|
||||
var buttons = options.buttons = (options.buttons || []).slice()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user