update padma infoView to use new groupsDialog
This commit is contained in:
parent
a894a39c4d
commit
9da3310608
1 changed files with 21 additions and 4 deletions
|
@ -411,6 +411,7 @@ pandora.ui.infoView = function(data) {
|
||||||
// User and Groups ---------------------------------------------------------
|
// User and Groups ---------------------------------------------------------
|
||||||
|
|
||||||
['user', 'groups'].forEach(function(key) {
|
['user', 'groups'].forEach(function(key) {
|
||||||
|
var $input;
|
||||||
(canEdit || data[key] && data[key].length) && $('<div>')
|
(canEdit || data[key] && data[key].length) && $('<div>')
|
||||||
.css({marginBottom: '4px'})
|
.css({marginBottom: '4px'})
|
||||||
.append(formatKey(key, 'statistics'))
|
.append(formatKey(key, 'statistics'))
|
||||||
|
@ -418,17 +419,33 @@ pandora.ui.infoView = function(data) {
|
||||||
$('<div>')
|
$('<div>')
|
||||||
.css({margin: '2px 0 0 -1px'}) // fixme: weird
|
.css({margin: '2px 0 0 -1px'}) // fixme: weird
|
||||||
.append(
|
.append(
|
||||||
Ox.Editable({
|
$input = Ox.Editable({
|
||||||
placeholder: key == 'groups' ? formatLight(Ox._('No Groups')) : '',
|
placeholder: key == 'groups' ? formatLight(Ox._('No Groups')) : '',
|
||||||
editable: canEdit,
|
editable: key == 'user' && canEdit,
|
||||||
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
||||||
value: key == 'user' ? data[key] : data[key].join(', ')
|
value: key == 'user' ? data[key] : data[key].join(', ')
|
||||||
})
|
})
|
||||||
.bindEvent({
|
.bindEvent(Ox.extend({
|
||||||
submit: function(event) {
|
submit: function(event) {
|
||||||
editMetadata(key, event.value);
|
editMetadata(key, event.value);
|
||||||
}
|
}
|
||||||
})
|
}, key == 'groups' ? {
|
||||||
|
doubleclick: function() {
|
||||||
|
pandora.$ui.groupsDialog = pandora.ui.groupsDialog({
|
||||||
|
id: data.id,
|
||||||
|
name: data.title,
|
||||||
|
type: 'item'
|
||||||
|
})
|
||||||
|
.bindEvent({
|
||||||
|
groups: function(data) {
|
||||||
|
$input.options({
|
||||||
|
value: data.groups.join(', ')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.open();
|
||||||
|
}
|
||||||
|
} : {}))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.appendTo($statistics);
|
.appendTo($statistics);
|
||||||
|
|
Loading…
Reference in a new issue