mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
updated alias dialog...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3e8d0a6bba
commit
764e78b4f4
@ -109,6 +109,7 @@ module.Alias = core.ImageGridFeatures.Feature({
|
|||||||
|
|
||||||
var UIAliasActions = actions.Actions({
|
var UIAliasActions = actions.Actions({
|
||||||
// XXX should this update the parent???
|
// XXX should this update the parent???
|
||||||
|
// XXX updating this does not work yet...
|
||||||
browseAliases: ['System/Aliases...',
|
browseAliases: ['System/Aliases...',
|
||||||
widgets.makeUIDialog(function(){
|
widgets.makeUIDialog(function(){
|
||||||
var that = this
|
var that = this
|
||||||
@ -119,6 +120,8 @@ var UIAliasActions = actions.Actions({
|
|||||||
var getKeys = function(action){
|
var getKeys = function(action){
|
||||||
return (keys[action] || []).join(' / ') }
|
return (keys[action] || []).join(' / ') }
|
||||||
|
|
||||||
|
var to_remove = []
|
||||||
|
|
||||||
return browse.makeLister(null,
|
return browse.makeLister(null,
|
||||||
function(path, make){
|
function(path, make){
|
||||||
var dialog = this
|
var dialog = this
|
||||||
@ -127,18 +130,24 @@ var UIAliasActions = actions.Actions({
|
|||||||
var names = Object.keys(aliases)
|
var names = Object.keys(aliases)
|
||||||
|
|
||||||
names.length > 0 ?
|
names.length > 0 ?
|
||||||
names
|
make.EditableList(names,
|
||||||
.forEach(function(name){
|
{
|
||||||
//make([name, (aliases[name]).slice(-1)[0]])
|
new_item: false,
|
||||||
make([name])
|
to_remove: to_remove,
|
||||||
|
|
||||||
|
itemopen: function(name){
|
||||||
|
that.editAlias(name)
|
||||||
|
.on('close', function(){ dialog.update() })
|
||||||
|
dialog.close()
|
||||||
|
},
|
||||||
|
|
||||||
|
each: function(name, elem){
|
||||||
|
$(elem)
|
||||||
.attr({
|
.attr({
|
||||||
keys: getKeys(name),
|
keys: getKeys(name),
|
||||||
action: name,
|
action: name,
|
||||||
})
|
})
|
||||||
.on('open', function(){
|
}
|
||||||
that.editAlias(name)
|
|
||||||
.on('close', function(){ dialog.update() })
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
: make.Empty()
|
: make.Empty()
|
||||||
|
|
||||||
@ -161,6 +170,11 @@ var UIAliasActions = actions.Actions({
|
|||||||
}
|
}
|
||||||
this.keyboard.handler('General', '?', 'showDoc')
|
this.keyboard.handler('General', '?', 'showDoc')
|
||||||
})
|
})
|
||||||
|
.close(function(){
|
||||||
|
to_remove.forEach(function(alias){
|
||||||
|
that.alias(alias, null)
|
||||||
|
})
|
||||||
|
})
|
||||||
})],
|
})],
|
||||||
|
|
||||||
// NOTE: this does not include an attr editor by design...
|
// NOTE: this does not include an attr editor by design...
|
||||||
|
|||||||
@ -434,6 +434,9 @@ function(list){
|
|||||||
// // if true, group the items into a <span> element...
|
// // if true, group the items into a <span> element...
|
||||||
// groupList: false,
|
// groupList: false,
|
||||||
//
|
//
|
||||||
|
// // process each dom element...
|
||||||
|
// each: <function>,
|
||||||
|
//
|
||||||
// // see: make(..) for additional option info.
|
// // see: make(..) for additional option info.
|
||||||
// ...
|
// ...
|
||||||
// }
|
// }
|
||||||
@ -498,6 +501,9 @@ function(data, options){
|
|||||||
keys !== data && data[k]
|
keys !== data && data[k]
|
||||||
&& elem.on('open', data[k])
|
&& elem.on('open', data[k])
|
||||||
|
|
||||||
|
opts.each
|
||||||
|
&& opts.each(txt || k, elem)
|
||||||
|
|
||||||
res.push(elem[0])
|
res.push(elem[0])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user