mirror of
https://github.com/documize/community.git
synced 2025-07-23 15:19:42 +02:00
parent
b89a297c70
commit
9a41e82aa3
5 changed files with 105 additions and 41 deletions
|
@ -9,8 +9,27 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(AuthMixin, {
|
||||
localStorage: service(),
|
||||
viewDensity: "1",
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
let viewDensity = this.get('localStorage').getSessionItem('spaces.density');
|
||||
if (!_.isNull(viewDensity) && !_.isUndefined(viewDensity)) {
|
||||
this.set('viewDensity', viewDensity);
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onSwitchView(v) {
|
||||
this.set('viewDensity', v);
|
||||
this.get('localStorage').storeSessionItem('spaces.density', v);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue