1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-21 14:19:43 +02:00

Pinned documents

Closes #278

Pin documents to the top of each space.
This commit is contained in:
sauls8t 2020-02-03 21:00:35 +00:00
parent 2b66d0096a
commit e014f5b5c1
18 changed files with 541 additions and 88 deletions

View file

@ -31,6 +31,9 @@ export default Component.extend({
hasDocumentActions: computed('permissions.{documentDelete,documentMove}', function() {
return this.get('permissions.documentDelete') || this.get('permissions.documentMove');
}),
hasCategoryFilter: computed('categoryFilter', function() {
return !_.isEmpty(this.get('categoryFilter'));
}),
didReceiveAttrs() {
this._super(...arguments);
@ -53,7 +56,7 @@ export default Component.extend({
let viewDensity = this.get('localStorage').getSessionItem('space.density');
if (!_.isNull(viewDensity) && !_.isUndefined(viewDensity)) {
this.set('viewDensity', viewDensity);
}
}
},
actions: {
@ -86,7 +89,7 @@ export default Component.extend({
},
// eslint-disable-next-line no-unused-vars
onSortBy(attacher) {
onSortBy(attacher) {
// attacher.hide();
this.get('onFiltered')(this.get('documents'));
},
@ -161,6 +164,18 @@ export default Component.extend({
this.set('selectedCaption', list.length > 1 ? 'documents' : 'document');
this.set('selectedDocuments', A(list));
}
},
onPin(documentId) {
this.get('onPin')(documentId);
},
onUnpin(documentId) {
this.get('onUnpin')(documentId);
},
onPinSequence(documentId, direction) {
this.get('onPinSequence')(documentId, direction);
},
}
});