Permalink
Browse files
Add events for sidebar opening and closing.
- Loading branch information...
Showing
with
8 additions
and
0 deletions.
-
+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