1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 23:59:47 +02:00

Merge pull request #377 from Ma27/preview-button-toggle

gui/editors: toggle Preview/Edit button
This commit is contained in:
Harvey Kandola 2020-11-12 18:57:42 +00:00 committed by GitHub
commit 972413110f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View file

@ -27,6 +27,10 @@ export default Component.extend(Modals, Notifier, {
return `page-editor-${page.id}`;
}),
previewText: 'Preview',
previewIcon: computed('previewIcon', function () {
let constants = this.get('constants');
return constants.Icon.Preview;
}),
pageTitle: '',
didReceiveAttrs() {
@ -102,8 +106,10 @@ export default Component.extend(Modals, Notifier, {
},
onPreview() {
let constants = this.get('constants');
let pt = this.get('previewText');
this.set('previewText', pt === 'Preview' ? 'Edit Mode' : 'Preview');
this.set('previewIcon', pt === 'Preview' ? constants.Icon.Edit : constants.Icon.Preview);
return this.get('onPreview')();
},