Skip to content

Commit

Permalink
do not update checkbox state if the request fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Oct 16, 2018
1 parent bc8a8b8 commit 9b1e9cb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions app/assets/javascripts/blacklight/blacklight.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ Blacklight.onLoad(function () {
data: form.serialize(),
error: function () {
alert('Error');
updateStateFor(checked);
label.removeAttr('disabled');
checkbox.removeAttr('disabled');
},
Expand All @@ -200,7 +199,6 @@ Blacklight.onLoad(function () {
options.success.call(form, checked, xhr.responseJSON);
} else {
alert('Error');
updateStateFor(checked);
label.removeAttr('disabled');
checkbox.removeAttr('disabled');
}
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/blacklight/checkbox_submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
data: form.serialize(),
error: function() {
alert('Error');
updateStateFor(checked);
label.removeAttr('disabled');
checkbox.removeAttr('disabled');
},
Expand All @@ -110,7 +109,6 @@
options.success.call(form, checked, xhr.responseJSON);
} else {
alert('Error');
updateStateFor(checked);
label.removeAttr('disabled');
checkbox.removeAttr('disabled');
}
Expand Down

0 comments on commit 9b1e9cb

Please sign in to comment.