merge add/remove buttons to infoview

This commit is contained in:
j 2024-03-08 12:37:30 +00:00
parent ee57469523
commit 4833681e28
1 changed files with 16 additions and 0 deletions

View File

@ -33,6 +33,13 @@ pandora.ui.documentInfoView = function(data, isMixed) {
}).map(function(key){
return key.id;
}),
displayedKeys = [ // FIXME: can tis be a flag in the config?
'title', 'notes', 'name', 'description', 'id',
'user', 'rightslevel', 'timesaccessed',
'extension', 'dimensions', 'size', 'matches',
'created', 'modified', 'accessed',
'random', 'entity'
].concat(pandora.site.documentKeys.filter(key => { return key.fulltext }).map(key => key.id)),
statisticsWidth = 128,
$bar = Ox.Bar({size: 16})
@ -655,6 +662,7 @@ pandora.ui.documentInfoView = function(data, isMixed) {
function renderGroup(keys) {
var $element;
keys.forEach(function(key) { displayedKeys.push(key) });
if (canEdit || keys.filter(function(key) {
return data[key];
}).length) {
@ -667,6 +675,7 @@ pandora.ui.documentInfoView = function(data, isMixed) {
$('<span>').html(formatKey(key)).appendTo($element);
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: canEdit,
format: function(value) {
return formatValue(key, value);
},
@ -680,6 +689,13 @@ pandora.ui.documentInfoView = function(data, isMixed) {
}
})
.appendTo($element);
if (isMixed[key] && Ox.contains(listKeys, key)) {
pandora.ui.addRemoveKeyDialog({
ids: ui.collectionSelection,
key: key,
section: ui.section
}).appendTo($element)
}
}
});
$element.appendTo($text);