Commit 395c0f82 authored by Benjamin Baer's avatar Benjamin Baer Committed by Carsten Rose
Browse files

Fixes #8272 upload save

parent 3ff3ea91
......@@ -110,6 +110,7 @@ var QfqNS = QfqNS || {};
}
this.fileUploader = new n.FileUpload('#' + this.formId, this.fileUploadTo);
this.startUploadHandler = this.startUploadHandler.bind(this);
this.fileUploader.on('fileupload.started', this.startUploadHandler);
this.fileUploader.on('fileupload.upload.successful', that.fileUploadSuccessHandler);
......@@ -117,6 +118,7 @@ var QfqNS = QfqNS || {};
function (obj) {
n.Helper.showAjaxError(null, obj.textStatus, obj.errorThrown);
});
this.endUploadHandler = this.endUploadHandler.bind(this);
this.fileUploader.on('fileupload.ended', this.endUploadHandler);
this.fileDeleter = new n.FileDelete("#" + this.formId, this.fileDeleteUrl);
......@@ -818,6 +820,16 @@ var QfqNS = QfqNS || {};
this.resetLockState();
};
n.QfqForm.prototype.deactivateSaveButton = function() {
this.getSaveButton().addClass("disabled");
this.getSaveButton().attr("disabled", "disabled");
};
n.QfqForm.prototype.activateSaveButton = function() {
this.getSaveButton().removeClass("disabled");
this.getSaveButton().removeAttr("disabled");
};
n.QfqForm.prototype.getSaveButtonAttentionClass = function () {
var $saveButton = this.getSaveButton();
......@@ -1199,6 +1211,7 @@ var QfqNS = QfqNS || {};
$(obj.target).after(
$('<i>').addClass('spinner')
);
this.deactivateSaveButton();
};
/**
......@@ -1208,6 +1221,7 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.endUploadHandler = function (obj) {
var $siblings = $(obj.target).siblings();
$siblings.filter("i").remove();
this.activateSaveButton();
};
/**
......
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