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

ELPP-3573 Resolve content header list wrapping #841

Merged
merged 14 commits into from
Apr 10, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/js/components/ContentHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,13 @@ module.exports = class ContentHeader {
if (newState === 'expanded') {
this.$elm.querySelector('.content-header__author_list').classList
.add('content-header__author_list--expanded');
this.$elm.querySelector('.content-header__institution_list').classList
.add('content-header__institution_list--expanded');
} else {
this.$elm.querySelector('.content-header__author_list').classList
.remove('content-header__author_list--expanded');
this.$elm.querySelector('.content-header__institution_list').classList
.remove('content-header__institution_list--expanded');
}
}

Expand Down
55 changes: 33 additions & 22 deletions assets/sass/patterns/organisms/content-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -466,17 +466,36 @@ $iconlist: cc oa;
display: block;
}

.content-header__author:after {
content: ", ";
.content-header__author_suffix {
white-space: nowrap;
}

.content-header__author--last-non-excess:after {
content: "";
.content-header__author_separator {
.content-header__author--last-non-excess & {
display: none;

.content-header__author_list--expanded & {
content: ", ";
.content-header__author_list--expanded & {
display: inline;
}
}
li.content-header__author_list_item:last-child &,
li.content-header__author_list_item--last & {
display: none;
}
}

.content-header__institution_separator {
.content-header__institution--last-non-excess & {
display: none;

.content-header__institution_list--expanded & {
display: inline;
}
}
li.content-header__institution_list_item:last-child &,
li.content-header__institution_list_item--last & {
display: none;
}
}

.content-header__author_link {
Expand All @@ -494,10 +513,6 @@ $iconlist: cc oa;
vertical-align: text-top;
}

li.content-header__author_list_item--last .content-header__author:after {
content: "";
}

.content-header__author--single {
@include author-typeg();
}
Expand All @@ -514,12 +529,8 @@ li.content-header__author_list_item--last .content-header__author:after {
padding: 0;
}

.content-header__institution:after {
content: "; ";
}

li.content-header__institution_list_item--last .content-header__institution:after {
content: "";
.content-header__item_toggle {
white-space: nowrap;
}

.content-header__item_toggle--author {
Expand All @@ -538,8 +549,12 @@ li.content-header__institution_list_item--last .content-header__institution:afte

@media only all and (min-width: #{get-rem-from-px($bkpt-site--medium)}em) {

.content-header__author--last-non-excess:after {
content: "";
.content-header__author--last-non-excess .content-header__author_separator {
display: none;
}

.content-header__institution--last-non-excess .content-header__institution_separator {
display: none;
}

.content-header__item_toggle {
Expand All @@ -566,10 +581,6 @@ li.content-header__institution_list_item--last .content-header__institution:afte
cursor: pointer;
}

.content-header__institution--last-non-excess:after {
content: "";
}

}

.content-header__cta {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@
<ol class="content-header__author_list">
{{#authors.list}}
<li class="content-header__author_list_item">
<span class="content-header__author">{{#url}}<a href="{{url}}" data-behaviour="Popup" class="content-header__author_link">{{/url}}{{name}}{{#url}}</a>{{/url}}{{#isCorresponding}}
<picture>
<span class="content-header__author">{{#url}}<a href="{{url}}" data-behaviour="Popup" class="content-header__author_link">{{/url}}{{name}}{{#url}}</a>{{/url}}<span class="content-header__author_suffix">{{#isCorresponding}}&nbsp;{{!
}}<picture>
<source srcset="{{#assetRewrite}}{{assetsPath}}/img/icons/corresponding-author.svg{{/assetRewrite}}" type="image/svg+xml">
<img src="{{#assetRewrite}}{{assetsPath}}/img/icons/[email protected]{{/assetRewrite}}"
srcset="{{#assetRewrite}}{{assetsPath}}/img/icons/[email protected]{{/assetRewrite}} 2x, {{#assetRewrite}}{{assetsPath}}/img/icons/[email protected]{{/assetRewrite}} 1x"
alt="Is a corresponding author" class="content-header__author_icon">
</picture>{{/isCorresponding}}</span>
</picture>{{/isCorresponding}}{{!
}}<span class="content-header__author_separator" aria-hidden="true">,</span>
</span></span>
</li>
{{/authors.list}}
</ol>
Expand All @@ -136,7 +138,9 @@
<ol class="content-header__institution_list">
{{#institutions.list}}
<li class="content-header__institution_list_item">
<span class="content-header__institution">{{{name}}}</span>
<span class="content-header__institution">{{{name}}}{{!
}}<span class="content-header__institution_separator" aria-hidden="true">;</span>
</span>
</li>
{{/institutions.list}}
</ol>
Expand Down