Commit eab9f32a authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Brought back fileDeleteUrl in QfqForm.js

parent 1837de41
......@@ -22,12 +22,13 @@ var QfqNS = QfqNS || {};
* @param fileUploadTo {string} url used for file uploads
* @constructor
*/
n.QfqForm = function (formId, submitTo, deleteUrl, dataRefreshUrl, fileUploadTo) {
n.QfqForm = function (formId, submitTo, deleteUrl, dataRefreshUrl, fileUploadTo, fileDeleteUrl) {
this.formId = formId;
this.submitTo = submitTo;
this.deleteUrl = deleteUrl;
this.dataRefreshUrl = dataRefreshUrl;
this.fileUploadTo = fileUploadTo;
this.fileDeleteUrl = fileDeleteUrl;
this.form = new n.Form(this.formId);
// This is required when displaying validation messages, in to activate the tab, which has validation issues
......@@ -84,6 +85,15 @@ var QfqNS = QfqNS || {};
* @private
*/
n.QfqForm.prototype.fileDeleteSuccessHandler = function (obj) {
if (!obj.data.status) {
throw Error("Response on file upload missing status");
}
if (obj.data.status === "error") {
var alert = new n.Alert(obj.data.message, "error");
alert.show();
return;
}
var $button = $(obj.target);
$button.prop("disabled", true);
......
Supports Markdown
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