forked from 0x2620/pandora
groups dialog: trigger event when selected group is renamed; fix label text
This commit is contained in:
parent
83c1ca111f
commit
a01d445a27
1 changed files with 10 additions and 1 deletions
|
@ -76,8 +76,17 @@ pandora.ui.groupsDialog = function(options) {
|
|||
}
|
||||
|
||||
function editGroup(id, name) {
|
||||
var index = Ox.getIndexById(groups, id),
|
||||
previousName = groups[index].name;
|
||||
// disableElements();
|
||||
pandora.api.editGroup({id: id, name: name}, function(result) {
|
||||
name = result.data.name;
|
||||
if (Ox.contains(selectedGroups, previousName)) {
|
||||
selectedGroups.splice(
|
||||
selectedGroups.indexOf(previousName), 1, name
|
||||
);
|
||||
that.triggerEvent('groups', {groups: selectedGroups});
|
||||
}
|
||||
renderGroups();
|
||||
});
|
||||
}
|
||||
|
@ -92,7 +101,7 @@ pandora.ui.groupsDialog = function(options) {
|
|||
function getLabelTitle(group) {
|
||||
return (group.items ? Ox.formatNumber(group.items) : Ox._('No'))
|
||||
+ ' ' + Ox._(group.items == 1 ? 'item' : 'items') + ', '
|
||||
+ (group.users ? Ox.formatNumber(group.users) : Ox._('No'))
|
||||
+ (group.users ? Ox.formatNumber(group.users) : Ox._('no'))
|
||||
+ ' ' + Ox._(group.users == 1 ? 'user' : 'users');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue