only show documents for current item
This commit is contained in:
parent
6e072a5635
commit
9c3abc84c8
1 changed files with 32 additions and 17 deletions
|
@ -386,8 +386,6 @@ pandora.ui.documentsPanel = function(options) {
|
||||||
selectDocuments
|
selectDocuments
|
||||||
);
|
);
|
||||||
|
|
||||||
selectDocuments();
|
|
||||||
|
|
||||||
function addDocuments() {
|
function addDocuments() {
|
||||||
pandora.$ui.documentsDialog = pandora.ui.documentsDialog().open();
|
pandora.$ui.documentsDialog = pandora.ui.documentsDialog().open();
|
||||||
}
|
}
|
||||||
|
@ -407,6 +405,7 @@ pandora.ui.documentsPanel = function(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function editDocuments() {
|
function editDocuments() {
|
||||||
|
pandora.UI.set('documentSelection.', $list.options('selected'));
|
||||||
pandora.$ui.documentsDialog = pandora.ui.documentsDialog().open();
|
pandora.$ui.documentsDialog = pandora.ui.documentsDialog().open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -567,7 +566,10 @@ pandora.ui.documentsPanel = function(options) {
|
||||||
var options = {
|
var options = {
|
||||||
items: pandora.api.findDocuments,
|
items: pandora.api.findDocuments,
|
||||||
keys: ['dimensions', 'extension', 'id', 'name', 'ratio', 'size'],
|
keys: ['dimensions', 'extension', 'id', 'name', 'ratio', 'size'],
|
||||||
query: {conditions: [], operator: '&'},
|
query: {
|
||||||
|
conditions: isItemView ? [{ key: 'item', value: ui.item }] : [],
|
||||||
|
operator: '&'
|
||||||
|
},
|
||||||
selected: ui.documentsSelection[isItemView ? ui.item : ''],
|
selected: ui.documentsSelection[isItemView ? ui.item : ''],
|
||||||
sort: ui.documentsSort.concat([
|
sort: ui.documentsSort.concat([
|
||||||
{key: 'extension', operator: '+'},
|
{key: 'extension', operator: '+'},
|
||||||
|
@ -622,6 +624,11 @@ pandora.ui.documentsPanel = function(options) {
|
||||||
sort: function(data) {
|
sort: function(data) {
|
||||||
pandora.UI.set({documentsSort: [data]});
|
pandora.UI.set({documentsSort: [data]});
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.bindEventOnce({
|
||||||
|
load: function() {
|
||||||
|
selectDocuments();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -690,8 +697,13 @@ pandora.ui.documentsPanel = function(options) {
|
||||||
var key = $findSelect.value(),
|
var key = $findSelect.value(),
|
||||||
value = $findInput.value(),
|
value = $findInput.value(),
|
||||||
query = {
|
query = {
|
||||||
conditions: value
|
conditions: [].concat(
|
||||||
? [].concat(
|
isItemView
|
||||||
|
? [{ key: 'item', value: ui.item }]
|
||||||
|
: [],
|
||||||
|
value
|
||||||
|
? {
|
||||||
|
conditions: [].concat(
|
||||||
key != 'user'
|
key != 'user'
|
||||||
? [{key: 'name', value: value, operator: '='}]
|
? [{key: 'name', value: value, operator: '='}]
|
||||||
: [],
|
: [],
|
||||||
|
@ -701,9 +713,12 @@ pandora.ui.documentsPanel = function(options) {
|
||||||
key != 'name'
|
key != 'name'
|
||||||
? [{key: 'user', value: value, operator: '='}]
|
? [{key: 'user', value: value, operator: '='}]
|
||||||
: []
|
: []
|
||||||
)
|
),
|
||||||
: [],
|
|
||||||
operator: '|'
|
operator: '|'
|
||||||
|
}
|
||||||
|
: []
|
||||||
|
),
|
||||||
|
operator: '&'
|
||||||
};
|
};
|
||||||
$list.options({query: query});
|
$list.options({query: query});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue