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

Change attachment deletion confirmation from modal to popover

This commit is contained in:
Harvey Kandola 2019-01-15 20:14:32 +00:00
parent d281621d90
commit 1ef209b74f
3 changed files with 21 additions and 26 deletions

View file

@ -29,11 +29,6 @@ export default Component.extend(Modals, Notifier, {
showDialog: false,
downloadQuery: '',
init() {
this._super(...arguments);
this.deleteAttachment = { id: '', name: '' };
},
didReceiveAttrs() {
this._super(...arguments);
this.getAttachments();
@ -94,6 +89,8 @@ export default Component.extend(Modals, Notifier, {
let qry = '';
if (this.get('session.authenticated')) {
qry = '?token=' + this.get('session.authToken');
} else {
qry = '?secure=' + this.get('session.secureToken');
}
this.set('downloadQuery', qry);
},
@ -105,26 +102,11 @@ export default Component.extend(Modals, Notifier, {
},
actions: {
onShowDialog(id, name) {
this.set('deleteAttachment', { id: id, name: name });
this.set('showDialog', true);
},
onDelete() {
this.set('showDialog', false);
let attachment = this.get('deleteAttachment');
onDelete(attachment) {
this.get('documentService').deleteAttachment(this.get('document.id'), attachment.id).then(() => {
this.notifySuccess('File deleted');
this.getAttachments();
this.set('deleteAttachment', {
id: "",
name: ""
});
});
return true;
},
onExport() {