summaryrefslogtreecommitdiff
path: root/web-ui/app/js
diff options
context:
space:
mode:
authorFelix Hammerl <fhammerl@thoughtworks.com>2016-02-08 17:54:56 +0100
committerFelix Hammerl <fhammerl@thoughtworks.com>2016-02-08 18:10:53 +0100
commitc16af6af2fa6798f5c3f9badfb445e87982e9dc3 (patch)
tree294df6b1892b5bfdd87449ab04c1bd27d158ba0d /web-ui/app/js
parente713820dc119ff33fdd3b3161ad693fb430c32f4 (diff)
Revert "Issue #549 - Removing the attachment from UI"
This reverts commit 1d1132e3779cb3a95b6c5685e358d422074741e5.
Diffstat (limited to 'web-ui/app/js')
-rw-r--r--web-ui/app/js/mail_view/ui/attachment_list.js21
1 files changed, 5 insertions, 16 deletions
diff --git a/web-ui/app/js/mail_view/ui/attachment_list.js b/web-ui/app/js/mail_view/ui/attachment_list.js
index c8a646af..3d57ede5 100644
--- a/web-ui/app/js/mail_view/ui/attachment_list.js
+++ b/web-ui/app/js/mail_view/ui/attachment_list.js
@@ -181,29 +181,18 @@ define(
this.select('inputFileUpload').click();
};
- this.removeAttachmentFromList = function(attachment) {
- for (var i = 0; i < this.attr.attachments.length; i++) {
- if (this.attr.attachments[i].ident === attachment.ident) {
- this.attr.attachments.remove(i);
- break;
- }
- }
- };
-
- this.destroyAttachmentElement = function(attachment) {
- this.$node.find('li[data-ident=' + attachment.ident + ']').remove();
- };
-
this.removeAttachments = function(event, data) {
var success = function() {
- this.removeAttachmentFromList(data);
- this.destroyAttachmentElement(data);
console.log('Success');
};
+ var failure = function() {
+ console.log('Fail!!!!!');
+ };
+
monitoredAjax(this, '/attachment/' + data.ident, {
type: 'DELETE'
- }).done(success.bind(this));
+ }).done(success.bind(this)).fail(failure.bind(this));
};
this.after('initialize', function () {