Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/additional info scroll #113

Merged
merged 3 commits into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/app/api/concepts/movie_appearances.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"parent": "movie_appearances",
"label": "Action Movies",
"matchingEntries": 8234,
"dateRange":{"lowerEndpoint":"2009-12-07","lowerBoundType":"CLOSED","upperEndpoint":"2018-03-20","upperBoundType":"CLOSED"},
"additionalInfos": [
{
"key": "Action film",
Expand Down
42 changes: 22 additions & 20 deletions frontend/lib/js/tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,30 @@ const Tooltip = (props: PropsType) => {
return (
<div className="tooltip">
<div className="tooltip__left">
{
!label && !description &&
<p className="tooltip__placeholder">
{ T.translate('tooltip.placeholder') }
</p>
}
<h3 className="tooltip__headline">
<div>
{
label
} {
description &&
<span> - {description}</span>
!label && !description &&
<p className="tooltip__placeholder">
{ T.translate('tooltip.placeholder') }
</p>
}
</h3>
{
infos && infos.map((info, i) => (
<div className="tooltip-info" key={i}>
<h3 className="tooltip-info__key" >{info.key}</h3>
<Markdown className="tooltip-info__value" source={info.value} />
</div>
))
}
<h3 className="tooltip__headline">
{
label
} {
description &&
<span> - {description}</span>
}
</h3>
{
infos && infos.map((info, i) => (
<div className="tooltip-info" key={i}>
<h3 className="tooltip-info__key" >{info.key}</h3>
<Markdown className="tooltip-info__value" source={info.value} />
</div>
))
}
</div>
</div>
<TooltipEntries
className="tooltip__right"
Expand Down
21 changes: 17 additions & 4 deletions frontend/lib/styles/components/tooltip.sass
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.tooltip
background-color: $col-bg
padding: 10px 20px
display: table
width: 100%
height: 100%
position: relative
overflow: hidden
display: flex

&--activate
padding: 0 20px
Expand All @@ -13,12 +14,24 @@
font-size: $font-sm
margin: 5px 0 5px

&__left, &__right
display: table-cell
vertical-align: middle
&__left
flex: 1
width: 100%
height: 100%
overflow: hidden
position: relative

& > div
position: absolute
top: 0
bottom: 0
left: 0
right: -17px
overflow-y: scroll

&__right
width: 35%
flex: 1

&__placeholder
color: $col-gray
Expand Down