Commit 6bb97e4c authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

FileDelete.js: use event.delegateTarget, to catch the element the handler is attached to.

parent b1974b79
......@@ -56,9 +56,9 @@ var QfqNS = QfqNS || {};
};
n.FileDelete.prototype.performFileDelete = function (event) {
this.eventEmitter.emitEvent('filedelete.started', n.EventEmitter.makePayload(event.target, null));
this.eventEmitter.emitEvent('filedelete.started', n.EventEmitter.makePayload(event.delegateTarget, null));
var data = this.prepareData(event.target);
var data = this.prepareData(event.delegateTarget);
$.ajax({
url: this.targetUrl,
......@@ -66,8 +66,8 @@ var QfqNS = QfqNS || {};
data: data,
cache: false
})
.done(this.ajaxSuccessHandler.bind(this, event.target))
.fail(this.ajaxErrorHandler.bind(this, event.target));
.done(this.ajaxSuccessHandler.bind(this, event.delegateTarget))
.fail(this.ajaxErrorHandler.bind(this, event.delegateTarget));
};
n.FileDelete.prototype.prepareData = function (htmlButton) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment