Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
3a6b806c
Commit
3a6b806c
authored
May 25, 2017
by
Robert Hodan
Committed by
Juan Corona
Jun 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow Host to call setVisibleHighlights for all Guests
parent
ea8294e9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
guest.coffee
src/annotator/guest.coffee
+0
-2
host.coffee
src/annotator/host.coffee
+6
-0
toolbar.coffee
src/annotator/plugin/toolbar.coffee
+1
-1
frame-sync.js
src/sidebar/frame-sync.js
+5
-2
No files found.
src/annotator/guest.coffee
View file @
3a6b806c
...
@@ -471,9 +471,7 @@ module.exports = class Guest extends Delegator
...
@@ -471,9 +471,7 @@ module.exports = class Guest extends Delegator
# Pass true to show the highlights in the frame or false to disable.
# Pass true to show the highlights in the frame or false to disable.
setVisibleHighlights
:
(
shouldShowHighlights
)
->
setVisibleHighlights
:
(
shouldShowHighlights
)
->
@
crossframe
?
.
call
(
'setVisibleHighlights'
,
shouldShowHighlights
)
this
.
toggleHighlightClass
(
shouldShowHighlights
)
this
.
toggleHighlightClass
(
shouldShowHighlights
)
this
.
publish
'setVisibleHighlights'
,
shouldShowHighlights
toggleHighlightClass
:
(
shouldShowHighlights
)
->
toggleHighlightClass
:
(
shouldShowHighlights
)
->
if
shouldShowHighlights
if
shouldShowHighlights
...
...
src/annotator/host.coffee
View file @
3a6b806c
...
@@ -64,3 +64,9 @@ module.exports = class Host extends Guest
...
@@ -64,3 +64,9 @@ module.exports = class Host extends Guest
destroy
:
->
destroy
:
->
@
frame
.
remove
()
@
frame
.
remove
()
super
super
setAllVisibleHighlights
:
(
shouldShowHighlights
)
->
@
crossframe
.
call
(
'setVisibleHighlights'
,
shouldShowHighlights
)
# Let the Toolbar know about this event
this
.
publish
'setVisibleHighlights'
,
shouldShowHighlights
src/annotator/plugin/toolbar.coffee
View file @
3a6b806c
...
@@ -49,7 +49,7 @@ module.exports = class Toolbar extends Plugin
...
@@ -49,7 +49,7 @@ module.exports = class Toolbar extends Plugin
event
.
preventDefault
()
event
.
preventDefault
()
event
.
stopPropagation
()
event
.
stopPropagation
()
state
=
not
@
annotator
.
visibleHighlights
state
=
not
@
annotator
.
visibleHighlights
@
annotator
.
setVisibleHighlights
state
@
annotator
.
set
All
VisibleHighlights
state
,
,
"title"
:
"New Page Note"
"title"
:
"New Page Note"
"class"
:
"h-icon-note"
"class"
:
"h-icon-note"
...
...
src/sidebar/frame-sync.js
View file @
3a6b806c
...
@@ -150,14 +150,17 @@ function FrameSync($rootScope, $window, Discovery, annotationUI, bridge) {
...
@@ -150,14 +150,17 @@ function FrameSync($rootScope, $window, Discovery, annotationUI, bridge) {
$rootScope
.
$broadcast
(
'sidebarOpened'
);
$rootScope
.
$broadcast
(
'sidebarOpened'
);
});
});
// These
merely relay call
s
// These
invoke the matching methods by name on the Guest
s
bridge
.
on
(
'showSidebar'
,
function
()
{
bridge
.
on
(
'showSidebar'
,
function
()
{
bridge
.
call
(
'showSidebar'
);
bridge
.
call
(
'showSidebar'
);
});
});
bridge
.
on
(
'hideSidebar'
,
function
()
{
bridge
.
on
(
'hideSidebar'
,
function
()
{
bridge
.
call
(
'hideSidebar'
);
bridge
.
call
(
'hideSidebar'
);
});
});
bridge
.
on
(
'setVisibleHighlights'
,
function
(
state
)
{
bridge
.
call
(
'setVisibleHighlights'
,
state
);
});
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment