Trigger.coffee 447 B

123456789101112131415161718
  1. class Trigger extends Class
  2. constructor: ->
  3. @trigger_off = true
  4. handleTitleClick: =>
  5. if @trigger_off
  6. @trigger_off = false
  7. document.body.classList.add("trigger-on")
  8. else
  9. document.body.classList.remove("trigger-on")
  10. @trigger_off = true
  11. return false
  12. render: =>
  13. h("div.Trigger", {classes: { "trigger-off": @trigger_off }}, [
  14. h("a.icon", {"href": "#Trigger", onclick: @handleTitleClick})
  15. ])
  16. window.Trigger = Trigger