@terakilobyte cleaned up event handlers
This commit is contained in:
@ -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();
|
||||||
|
Reference in New Issue
Block a user