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

Export single or multiple documents

This commit is contained in:
HarveyKandola 2018-07-29 10:59:24 -04:00
parent cf0b06923d
commit def01b6265
8 changed files with 74 additions and 13 deletions

View file

@ -18,6 +18,8 @@ export default Controller.extend(NotifierMixin, {
documentService: service('document'),
folderService: service('folder'),
localStorage: service('localStorage'),
browserSvc: service('browser'),
documentSvc: service('document'),
queryParams: ['category'],
category: '',
filteredDocs: null,
@ -71,6 +73,21 @@ export default Controller.extend(NotifierMixin, {
});
},
onExportDocument(documents) {
this.showWait();
let spec = {
spaceId: this.get('model.folder.id'),
data: documents,
filterType: 'document',
};
this.get('documentSvc').export(spec).then((htmlExport) => {
this.get('browserSvc').downloadFile(htmlExport, this.get('model.folder.slug') + '.html');
this.showDone();
});
},
onFiltered(docs) {
this.set('filteredDocs', docs);
}