mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
Change attachment deletion confirmation from modal to popover
This commit is contained in:
parent
d281621d90
commit
1ef209b74f
3 changed files with 21 additions and 26 deletions
|
@ -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() {
|
||||
|
|
|
@ -36,9 +36,10 @@ export default Component.extend(AuthMixin, Notifier, {
|
|||
$("#delete-space-name").removeClass("is-invalid");
|
||||
|
||||
this.get('spaceSvc').delete(this.get('space.id')).then(() => { /* jshint ignore:line */
|
||||
this.get('localStorage').clearSessionItem('folder');
|
||||
this.get('router').transitionTo('folders');
|
||||
});
|
||||
|
||||
this.get('localStorage').clearSessionItem('folder');
|
||||
this.get('router').transitionTo('folders');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue