Files
nairobi/app/assets/javascripts/legislation_allegations.js.coffee
Javi Martín b27855c1cf Use double quotes in CoffeeScript files
As we do in the rest of the application.

Note we cannot add a rule enforcing double quotes because CoffeeScript
Lint does not have such rule.
2019-03-06 11:41:21 +01:00

26 lines
859 B
CoffeeScript

App.LegislationAllegations =
toggle_comments: ->
if !App.LegislationAnnotatable.isMobile()
$(".draft-allegation").toggleClass("comments-on")
$("#comments-box").html("").hide()
show_comments: ->
if !App.LegislationAnnotatable.isMobile()
$(".draft-allegation").addClass("comments-on")
initialize: ->
$(".js-toggle-allegations .draft-panel").on
click: (e) ->
e.preventDefault()
e.stopPropagation()
if !App.LegislationAnnotatable.isMobile()
App.LegislationAllegations.toggle_comments()
$(".js-toggle-allegations").on
click: (e) ->
# Toggle comments when the section title is visible
if !App.LegislationAnnotatable.isMobile()
if $(this).find(".draft-panel .panel-title:visible").length == 0
App.LegislationAllegations.toggle_comments()