mirror of
https://github.com/documize/community.git
synced 2025-08-04 21:15:24 +02:00
Revamp document view using new layout
New master page system and UI framework implemented on document view. Sidebar contains ToC and Attachments.
This commit is contained in:
parent
b4b3dbcb4c
commit
7cdf97aa86
27 changed files with 348 additions and 263 deletions
|
@ -18,6 +18,7 @@ import Component from '@ember/component';
|
|||
|
||||
export default Component.extend(Modals, Notifier, {
|
||||
documentService: service('document'),
|
||||
browserSvc: service('browser'),
|
||||
appMeta: service(),
|
||||
hasAttachments: notEmpty('files'),
|
||||
canEdit: computed('permissions.documentEdit', 'document.protection', function() {
|
||||
|
@ -114,6 +115,15 @@ export default Component.extend(Modals, Notifier, {
|
|||
});
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
onExport() {
|
||||
this.get('documentSvc').export({}).then((htmlExport) => {
|
||||
this.get('browserSvc').downloadFile(htmlExport, this.get('space.slug') + '.html');
|
||||
this.notifySuccess('Exported');
|
||||
});
|
||||
|
||||
this.modalClose("#space-export-modal");
|
||||
}
|
||||
}
|
||||
});
|
|
@ -16,6 +16,7 @@ import tocUtil from '../../utils/toc';
|
|||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
classNames: ["section"],
|
||||
documentService: service('document'),
|
||||
emptyState: computed('pages', function () {
|
||||
return this.get('pages.length') === 0;
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
import { A } from '@ember/array';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { schedule } from '@ember/runloop';
|
||||
import { computed } from '@ember/object';
|
||||
import { empty } from '@ember/object/computed';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
|
|
|
@ -16,7 +16,6 @@ export default Component.extend({
|
|||
tagName: 'div',
|
||||
classNames: [],
|
||||
classNameBindings: ['calcClass'],
|
||||
|
||||
where: 'right',
|
||||
calcClass: computed(function() {
|
||||
return `dmz-button-gap-${this.where}`;
|
||||
|
|
|
@ -62,8 +62,8 @@ export default Component.extend({
|
|||
}),
|
||||
|
||||
click(e) {
|
||||
e.preventDefault();
|
||||
if (is.not.undefined(this.onClick)) {
|
||||
e.preventDefault();
|
||||
this.onClick(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,17 +18,19 @@ export default Component.extend({
|
|||
tagName: 'i',
|
||||
classNames: ['dicon'],
|
||||
classNameBindings: ['calcClass'],
|
||||
|
||||
color: '',
|
||||
icon: '',
|
||||
tooltip: '',
|
||||
selected: false,
|
||||
|
||||
calcClass: computed(function() {
|
||||
calcClass: computed('selected', function() {
|
||||
let c = '';
|
||||
let icon = this.icon;
|
||||
|
||||
if (this.color !== '') c += this.color + ' ';
|
||||
|
||||
if (this.selected === true) c += 'icon-selected' + ' ';
|
||||
|
||||
if (icon !== '') c += icon + ' ';
|
||||
|
||||
return c.trim();
|
||||
|
|
|
@ -18,7 +18,6 @@ export default Component.extend({
|
|||
tagName: 'div',
|
||||
classNames: ['label'],
|
||||
classNameBindings: ['calcClass'],
|
||||
|
||||
color: '',
|
||||
label: '',
|
||||
tooltip: '',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue