Toggle only works on column when the section is not visible
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user