1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

Provide view density switcher for spaces & space view

Closes #218
This commit is contained in:
McMatts 2019-03-13 15:17:15 +00:00
parent b89a297c70
commit 9a41e82aa3
5 changed files with 105 additions and 41 deletions

View file

@ -20,6 +20,7 @@ export default Component.extend({
showMoveDialog: false,
selectedDocuments: A([]),
selectedCaption: 'document',
viewDensity: "1",
showAdd: computed('permissions.documentAdd', 'documents', function() {
return this.get('documents.length') === 0 && this.get('permissions.documentAdd');
@ -48,6 +49,11 @@ export default Component.extend({
if (!_.isNull(sortOrder) && !_.isUndefined(sortOrder)) {
this.send('onSetSort', sortOrder);
}
let viewDensity = this.get('localStorage').getSessionItem('space.density');
if (!_.isNull(viewDensity) && !_.isUndefined(viewDensity)) {
this.set('viewDensity', viewDensity);
}
},
actions: {
@ -85,6 +91,11 @@ export default Component.extend({
this.get('onFiltered')(this.get('documents'));
},
onSwitchView(v) {
this.set('viewDensity', v);
this.get('localStorage').storeSessionItem('space.density', v);
},
onShowDeleteDocuments() {
this.set('showDeleteDialog', true);
},