mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
fddb35b9c7
commit
c81acad83a
@ -2081,29 +2081,36 @@ var UICollectionActions = actions.Actions({
|
|||||||
// element edit...
|
// element edit...
|
||||||
// XXX should this be generic???
|
// XXX should this be generic???
|
||||||
menu: function(_, from){
|
menu: function(_, from){
|
||||||
var f = $(this).find('.text').last().attr('text') || from
|
var elem = $(this).find('.text').last()
|
||||||
|
from = elem.attr('text') || from
|
||||||
|
|
||||||
$(this).find('.text').last()
|
elem
|
||||||
.html(f)
|
// NOTE: we need to do this to account for
|
||||||
|
// '$' in names...
|
||||||
|
.html(from)
|
||||||
.makeEditable({
|
.makeEditable({
|
||||||
activate: true,
|
activate: true,
|
||||||
clear_on_edit: false,
|
clear_on_edit: false,
|
||||||
abort_keys: [
|
abort_keys: [
|
||||||
'Esc',
|
'Esc',
|
||||||
|
'Up',
|
||||||
|
'Down',
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.on('edit-commit', function(_, to){
|
.on('edit-commit', function(_, to){
|
||||||
// check if name unique... (???)
|
to = to.trim()
|
||||||
if(to in that.collections){
|
// check if name is unique or empty...
|
||||||
|
if(to in that.collections || to == ''){
|
||||||
// XXX ???
|
// XXX ???
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX need to get the real from...
|
// XXX need to get the real from...
|
||||||
that.renameCollection(f, to)
|
that.renameCollection(from, to)
|
||||||
|
|
||||||
|
// rename was successful...
|
||||||
if(to in that.collections){
|
if(to in that.collections){
|
||||||
collections[collections.indexOf(f)] = to
|
collections[collections.indexOf(from)] = to
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('edit-abort edit-commit', function(_, title){
|
.on('edit-abort edit-commit', function(_, title){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user