Commit 3a6b806c authored by Robert Hodan's avatar Robert Hodan Committed by Juan Corona

Allow Host to call setVisibleHighlights for all Guests

parent ea8294e9
......@@ -471,9 +471,7 @@ module.exports = class Guest extends Delegator
# Pass true to show the highlights in the frame or false to disable.
setVisibleHighlights: (shouldShowHighlights) ->
@crossframe?.call('setVisibleHighlights', shouldShowHighlights)
this.toggleHighlightClass(shouldShowHighlights)
this.publish 'setVisibleHighlights', shouldShowHighlights
toggleHighlightClass: (shouldShowHighlights) ->
if shouldShowHighlights
......
......@@ -64,3 +64,9 @@ module.exports = class Host extends Guest
destroy: ->
@frame.remove()
super
setAllVisibleHighlights: (shouldShowHighlights) ->
@crossframe.call('setVisibleHighlights', shouldShowHighlights)
# Let the Toolbar know about this event
this.publish 'setVisibleHighlights', shouldShowHighlights
......@@ -49,7 +49,7 @@ module.exports = class Toolbar extends Plugin
event.preventDefault()
event.stopPropagation()
state = not @annotator.visibleHighlights
@annotator.setVisibleHighlights state
@annotator.setAllVisibleHighlights state
,
"title": "New Page Note"
"class": "h-icon-note"
......
......@@ -150,14 +150,17 @@ function FrameSync($rootScope, $window, Discovery, annotationUI, bridge) {
$rootScope.$broadcast('sidebarOpened');
});
// These merely relay calls
// These invoke the matching methods by name on the Guests
bridge.on('showSidebar', function () {
bridge.call('showSidebar');
});
bridge.on('hideSidebar', function () {
bridge.call('hideSidebar');
});
bridge.on('setVisibleHighlights', function (state) {
bridge.call('setVisibleHighlights', state);
});
}
/**
......
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