Trigger.coffee 476 B

12345678910111213141516171819
  1. class Trigger extends Class
  2. constructor: ->
  3. @active = false
  4. handleTitleClick: =>
  5. @active = not @active
  6. if @active
  7. document.getElementById("left").classList.add("trigger-on")
  8. else
  9. document.getElementById("left").classList.remove("trigger-on")
  10. return false
  11. render: =>
  12. h("div.Trigger", {classes: { "active": @active }}, [
  13. h("a.icon", {"href": "#Trigger", onclick: @handleTitleClick, ontouchend: ""}, h("div.arrow-right"))
  14. ])
  15. window.Trigger = Trigger