Finish full functionality for intial release of camper news

This commit is contained in:
Nathan Leniz
2015-03-07 20:51:20 +09:00
parent a3769f6507
commit b776be58e5
7 changed files with 96 additions and 110 deletions

View File

@@ -191,9 +191,11 @@ $(document).ready(function() {
$('#story-submit').on('click', storySubmitButtonHandler);
var commentSubmitButtonHandler = function commentSubmitButtonHandler() {
$('comment-button').unbind('click');
var data = $('#comment-box').val();
console.log('comment clicked');
$('#comment-button').unbind('click');
$('#comment-button').attr('disabled', 'disabled');
$.post('/stories/comment/',
{
data: {
@@ -207,7 +209,7 @@ $(document).ready(function() {
}
})
.fail(function (xhr, textStatus, errorThrown) {
$('#comment-button').bind('click', commentSubmitButtonHandler);
$('#comment-button').attr('disabled', false);
})
.done(function (data, textStatus, xhr) {
window.location.reload();