Commit a9edef48 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'F8272-uploadSave' into 'master'

F8272 upload save

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