Permalink
Browse files

Add events for sidebar opening and closing.

  • Loading branch information...
JakeHartnell committed Aug 27, 2015
1 parent 8357ee3 commit 911048c30fb1bddbb85c18685b4c1788aedc1918
Showing with 8 additions and 0 deletions.
  1. +8 −0 h/static/scripts/annotator/host.coffee
@@ -61,6 +61,10 @@ module.exports = class Host extends Guest
super
showFrame: (options={transition: true}) ->
# Emit event for integrators to be able to react to sidebar.
showFrameEvent = new Event('hypothesisSidebarOpen')
window.dispatchEvent(showFrameEvent)
if options.transition
@frame.removeClass 'annotator-no-transition'
else
@@ -74,6 +78,10 @@ module.exports = class Host extends Guest
.addClass('h-icon-chevron-right')
hideFrame: ->
# Emit event for integrators to be able to react to sidebar.
hideFrameEvent = new Event('hypothesisSidebarClosed')
window.dispatchEvent(hideFrameEvent)
@frame.css 'margin-left': ''
@frame.removeClass 'annotator-no-transition'
@frame.addClass 'annotator-collapsed'

0 comments on commit 911048c

Please sign in to comment.