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
9078637e
Commit
9078637e
authored
Feb 25, 2021
by
Eduardo Sanz García
Committed by
Robert Knight
Feb 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Undo restructuring of the config variable
Convert a statement into an if/else for readability.
parent
fcb68cc9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
sidebar.js
src/annotator/sidebar.js
+15
-14
No files found.
src/annotator/sidebar.js
View file @
9078637e
...
...
@@ -65,26 +65,17 @@ export default class Sidebar extends Guest {
this
.
iframe
=
createSidebarIframe
(
config
);
const
{
externalContainerSelector
,
theme
,
openSidebar
,
annotations
,
query
,
group
,
}
=
config
;
if
(
externalContainerSelector
)
{
if
(
config
.
externalContainerSelector
)
{
this
.
externalFrame
=
/** @type {HTMLElement} */
(
document
.
querySelector
(
externalContainerSelector
))
??
element
;
(
document
.
querySelector
(
config
.
externalContainerSelector
))
??
element
;
this
.
externalFrame
.
appendChild
(
this
.
iframe
);
}
else
{
this
.
iframeContainer
=
document
.
createElement
(
'div'
);
this
.
iframeContainer
.
style
.
display
=
'none'
;
this
.
iframeContainer
.
className
=
'annotator-frame'
;
if
(
theme
===
'clean'
)
{
if
(
config
.
theme
===
'clean'
)
{
this
.
iframeContainer
.
classList
.
add
(
'annotator-frame--theme-clean'
);
}
else
{
this
.
bucketBar
=
new
BucketBar
(
...
...
@@ -123,7 +114,12 @@ export default class Sidebar extends Guest {
}
});
if
(
openSidebar
||
annotations
||
query
||
group
)
{
if
(
config
.
openSidebar
||
config
.
annotations
||
config
.
query
||
config
.
group
)
{
this
.
subscribe
(
'panelReady'
,
()
=>
this
.
show
());
}
...
...
@@ -134,7 +130,12 @@ export default class Sidebar extends Guest {
setSidebarOpen
:
open
=>
(
open
?
this
.
show
()
:
this
.
hide
()),
setHighlightsVisible
:
show
=>
this
.
setAllVisibleHighlights
(
show
),
});
this
.
toolbar
.
useMinimalControls
=
theme
===
'clean'
;
if
(
config
.
theme
===
'clean'
)
{
this
.
toolbar
.
useMinimalControls
=
true
;
}
else
{
this
.
toolbar
.
useMinimalControls
=
false
;
}
if
(
this
.
iframeContainer
)
{
// If using our own container frame for the sidebar, add the toolbar to it.
...
...
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