Skip to content

Commit

Permalink
Merge 5c07153 into 8755106
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Oct 25, 2018
2 parents 8755106 + 5c07153 commit 8497fbb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/assets/javascripts/blacklight/checkbox_submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
progress_label: "Saving...",
//css_class is added to elements added, plus used for id base
css_class: "toggle_my_kinda_form",
error: function() {
#optional callback
},
success: function(after_success_check_state) {
#optional callback
}
Expand Down Expand Up @@ -96,9 +99,9 @@
type: form.attr("method").toUpperCase(),
data: form.serialize(),
error: function() {
alert("Error");
label.removeAttr("disabled");
checkbox.removeAttr("disabled");
options.error.call();
},
success: function(data, status, xhr) {
//if app isn't running at all, xhr annoyingly
Expand All @@ -110,9 +113,9 @@
checkbox.removeAttr("disabled");
options.success.call(form, checked, xhr.responseJSON);
} else {
alert("Error");
label.removeAttr("disabled");
checkbox.removeAttr("disabled");
options.error.call();
}
}
});
Expand All @@ -128,6 +131,9 @@
$.fn.bl_checkbox_submit.defaults = {
//css_class is added to elements added, plus used for id base
css_class: "bl_checkbox_submit",
error: function() {
alert("Error");
},
success: function() {} //callback
};
})(jQuery);

0 comments on commit 8497fbb

Please sign in to comment.