fixed things

This commit is contained in:
nilsding 2014-12-15 07:47:56 +01:00
parent c0c279e6d8
commit a30e6509b5
2 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@ $(document).on "click", "button[name=ab-comments]", ->
btn = $(this)
aid = btn[0].dataset.aId
state = btn[0].dataset.state
commentBox = $("#ab-comments-#{aid}")
commentBox = $("#ab-comments-section-#{aid}")
switch state
when 'hidden'
@ -35,7 +35,7 @@ $(document).on "keyup", "input[name=ab-comment-new]", (evt) ->
success: (data, status, jqxhr) ->
console.log data
if data.success
$(".panel-footer#ab-comments-#{aid}").html data.render
$("#ab-comments-#{aid}").html data.render
input.val ''
ctr.html 160
$("span#ab-comment-count-#{aid}").html data.count
@ -62,4 +62,4 @@ $(document).on "input", "input[name=ab-comment-new]", (evt) ->
ctr.addClass 'text-danger'
else
ctr.removeClass 'text-danger'
ctr.addClass 'text-muted'
ctr.addClass 'text-muted'

View File

@ -45,6 +45,6 @@
.row
.col-md-6.col-md-offset-6.col-sm-8.col-sm-offset-4.col-xs-6.col-xs-offset-6.text-right
= render 'shared/answerbox_buttons', a: a
.panel-footer{id: "ab-comments-#{a.id}", style: 'display: none'}
= render 'shared/smiles', a: a
= render 'shared/comments', a: a
.panel-footer{id: "ab-comments-section-#{a.id}", style: 'display: none'}
%div{id: "ab-smiles-#{a.id}"}= render 'shared/smiles', a: a
%div{id: "ab-comments-#{a.id}"}= render 'shared/comments', a: a