@terakilobyte cleaned up event handlers

This commit is contained in:
Quincy Larson
2015-04-25 18:59:15 -07:00
parent 20c2b7a0ac
commit b8bffae47b

View File

@ -277,7 +277,7 @@ $(document).ready(function() {
$('#story-submit').on('click', storySubmitButtonHandler); $('#story-submit').on('click', storySubmitButtonHandler);
var commentSubmitButtonHandler = function commentSubmitButtonHandler() { var commentSubmitButtonHandler = function commentSubmitButtonHandler() {
$('comment-button').unbind('click'); $('#comment-button').unbind('click');
var data = $('#comment-box').val(); var data = $('#comment-box').val();
$('#comment-button').attr('disabled', 'disabled'); $('#comment-button').attr('disabled', 'disabled');
@ -292,6 +292,7 @@ $(document).ready(function() {
}) })
.fail(function (xhr, textStatus, errorThrown) { .fail(function (xhr, textStatus, errorThrown) {
$('#comment-button').attr('disabled', false); $('#comment-button').attr('disabled', false);
$('#comment-button').bind('click', commentSubmitButtonHandler);
}) })
.done(function (data, textStatus, xhr) { .done(function (data, textStatus, xhr) {
window.location.reload(); window.location.reload();