Commit 0bd98467 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Respect attribute `data-class-on-change` on save buttons.

parent ec26ad07
......@@ -517,7 +517,7 @@ var QfqNS = QfqNS || {};
*/
n.QfqForm.prototype.changeHandler = function (obj) {
this.getSaveButton().removeClass("disabled");
this.getSaveButton().addClass("alert-warning");
this.getSaveButton().addClass(this.getSaveButtonAttentionClass());
this.getSaveButton().removeAttr("disabled");
};
......@@ -528,11 +528,17 @@ var QfqNS = QfqNS || {};
* @private
*/
n.QfqForm.prototype.resetHandler = function (obj) {
this.getSaveButton().removeClass("alert-warning");
this.getSaveButton().removeClass(this.getSaveButtonAttentionClass());
this.getSaveButton().addClass("disabled");
this.getSaveButton().attr("disabled", "disabled");
};
n.QfqForm.prototype.getSaveButtonAttentionClass = function () {
var $saveButton = this.getSaveButton();
return $saveButton.data('class-on-change') || 'alert-warning';
};
/**
*
* @returns {jQuery|HTMLElement}
......
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