Commit 8a07194c authored by Ujvari Gergely's avatar Ujvari Gergely Committed by Randall Leeds

Do not hide sidebar when @noBack is set.

In always-on mode clicking highlight now opens the sidebar.
Fixes #669
parent d2a7e3ae
......@@ -93,7 +93,7 @@ class Annotator.Guest extends Annotator
_setupWrapper: ->
@wrapper = @element
.on 'click', =>
if not @ignoreMouseup
unless @ignoreMouseup or @noBack
setTimeout =>
unless @selectedRanges?.length
@panel?.notify method: 'back'
......@@ -163,9 +163,6 @@ class Annotator.Guest extends Annotator
onHighlightClick: (event) =>
return unless @highlightingMode or @alwaysOnMode and @noBack
# We have already prevented closing the sidebar, now reset this flag
@noBack = false
# Collect relevant annotations
annotations = $(event.target)
.parents('.annotator-hl')
......@@ -175,6 +172,9 @@ class Annotator.Guest extends Annotator
# Tell sidebar to show the viewer for these annotations
this.showViewer annotations
# We have already prevented closing the sidebar, now reset this flag
@noBack = false
setPersistentHighlights: (state) ->
body = $('body')
markerClass = 'annotator-highlights-always-on'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment