Toggle only works on column when the section is not visible

This commit is contained in:
Fernando Blat
2016-12-22 17:38:02 +01:00
parent 8065b4d2f7
commit 0f6ece0c30

View File

@@ -1,19 +1,17 @@
App.Allegations =
toggle_comments: ->
$('.draft-allegation').toggleClass('comments-on');
initialize: ->
$('.js-toggle-allegations .draft-panel').on
click: ->
console.log("panel")
click: (e) ->
e.preventDefault();
e.stopPropagation();
App.Allegations.toggle_comments()
$('.js-toggle-allegations').on
click: ->
console.log("column")
if $('.draft-allegation').hasClass('comments-on')
console.log("comments-on")
return false
else
click: (e) ->
# Toggle comments when the section title is visible
if $(this).find('.draft-panel .panel-title:visible').length == 0
App.Allegations.toggle_comments()