mirror of
https://github.com/documize/community.git
synced 2025-08-05 05:25:27 +02:00
parent
99a5418dba
commit
8baad7e2f0
22 changed files with 229 additions and 102 deletions
|
@ -18,17 +18,23 @@ export default Component.extend({
|
|||
editMode: false,
|
||||
editPage: null,
|
||||
editMeta: null,
|
||||
expanded: true,
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) return;
|
||||
|
||||
let pageId = this.get('page.id');
|
||||
|
||||
if (this.get('session.authenticated')) {
|
||||
this.workflow();
|
||||
}
|
||||
|
||||
if (this.get('toEdit') === this.get('page.id') && this.get('permissions.documentEdit')) this.send('onEdit');
|
||||
if (this.get('toEdit') === pageId && this.get('permissions.documentEdit')) this.send('onEdit');
|
||||
|
||||
// Work out if this section is expanded by default (state stored in browser local storage).
|
||||
this.set('expanded', !_.includes(this.get('expandState'), pageId));
|
||||
},
|
||||
|
||||
workflow() {
|
||||
|
|
|
@ -38,6 +38,7 @@ export default Component.extend(Notifier, {
|
|||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
// Show/allow liking if space allows it and document is published.
|
||||
this.set('showLikes', this.get('folder.allowLikes') && this.get('document.isLive'));
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue