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
7eb5f40f
Commit
7eb5f40f
authored
May 11, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide the widget panel until ready for input
Close #2207
parent
158030d6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
host.coffee
h/static/scripts/annotator/host.coffee
+4
-0
host-test.coffee
h/static/scripts/annotator/test/host-test.coffee
+10
-0
No files found.
h/static/scripts/annotator/host.coffee
View file @
7eb5f40f
...
@@ -33,6 +33,7 @@ module.exports = class Host extends Guest
...
@@ -33,6 +33,7 @@ module.exports = class Host extends Guest
.
attr
(
'src'
,
src
)
.
attr
(
'src'
,
src
)
@
frame
=
$
(
'<div></div>'
)
@
frame
=
$
(
'<div></div>'
)
.
css
(
'display'
,
'none'
)
.
addClass
(
'annotator-frame annotator-outer annotator-collapsed'
)
.
addClass
(
'annotator-frame annotator-outer annotator-collapsed'
)
.
appendTo
(
element
)
.
appendTo
(
element
)
...
@@ -53,6 +54,9 @@ module.exports = class Host extends Guest
...
@@ -53,6 +54,9 @@ module.exports = class Host extends Guest
# these events and the UI will be out of sync.
# these events and the UI will be out of sync.
this
.
publish
(
'setVisibleHighlights'
,
!!
options
.
showHighlights
)
this
.
publish
(
'setVisibleHighlights'
,
!!
options
.
showHighlights
)
# Time to actually show the UI
@
frame
.
css
(
'display'
,
''
)
if
@
plugins
.
BucketBar
?
if
@
plugins
.
BucketBar
?
this
.
_setupGestures
()
this
.
_setupGestures
()
@
plugins
.
BucketBar
.
element
.
on
'click'
,
(
event
)
=>
@
plugins
.
BucketBar
.
element
.
on
'click'
,
(
event
)
=>
...
...
h/static/scripts/annotator/test/host-test.coffee
View file @
7eb5f40f
...
@@ -26,6 +26,16 @@ describe 'Host', ->
...
@@ -26,6 +26,16 @@ describe 'Host', ->
afterEach
->
sandbox
.
restore
()
afterEach
->
sandbox
.
restore
()
describe
'widget visibility'
,
->
it
'starts hidden'
,
->
host
=
createHost
()
assert
.
equal
(
host
.
frame
.
css
(
'display'
),
'none'
)
it
'becomes visible when the "panelReady" event fires'
,
->
host
=
createHost
()
host
.
publish
(
'panelReady'
)
assert
.
equal
(
host
.
frame
.
css
(
'display'
),
''
)
describe
'options'
,
->
describe
'options'
,
->
it
'enables highlighting when showHighlights option is provided'
,
(
done
)
->
it
'enables highlighting when showHighlights option is provided'
,
(
done
)
->
host
=
createHost
(
showHighlights
:
true
)
host
=
createHost
(
showHighlights
:
true
)
...
...
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