Skip to content

Commit fe2dc06

Browse files
committed
Merge branch 'develop' of https://github.com/OS2web/os2web8 into develop
2 parents 5513ff1 + edfcd7a commit fe2dc06

File tree

13 files changed

+241
-125
lines changed

13 files changed

+241
-125
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@
202202
"drupal/textfield_counter" : {
203203
"Fix scrolltop prevent" : "./patches/textfield_counter-scrolltop-fix.patch"
204204
},
205+
"drupal/easy_breadcrumb" : {
206+
"Fix frontpage page as part of the breadcrumb path" : "./patches/easy-breadcrumb-include-frontpage.patch"
207+
},
205208
"drupal/field_group": {
206209
"HTML5 Validation Prevents Submission in Tabs" : "https://www.drupal.org/files/issues/2019-10-04/field_group-HTML5_validation_prevents_submission_in_tabs-2969051-9.patch"
207210
},

composer.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/EasyBreadcrumbBuilder.php b/src/EasyBreadcrumbBuilder.php
2+
index 91cdf2f..64e8243 100644
3+
--- a/src/EasyBreadcrumbBuilder.php
4+
+++ b/src/EasyBreadcrumbBuilder.php
5+
@@ -832,7 +832,7 @@ class EasyBreadcrumbBuilder implements BreadcrumbBuilderInterface {
6+
7+
// Find the system path by resolving aliases, language prefix, etc.
8+
$processed = $this->pathProcessor->processInbound($path, $request);
9+
- if (empty($processed) || !empty($exclude[$processed])) {
10+
+ if ((empty($processed) || !empty($exclude[$processed])) && $this->config->get(EasyBreadcrumbConstants::INCLUDE_HOME_SEGMENT)) {
11+
12+
// This resolves to the front page, which we already add.
13+
return NULL;

web/themes/custom/fds_redwhite_theme/dist/javascripts/app.js

Lines changed: 40 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/themes/custom/fds_redwhite_theme/dist/stylesheets/stylesheet.css

Lines changed: 4 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/themes/custom/fds_redwhite_theme/fds_redwhite_theme.theme

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,20 @@ function fds_redwhite_theme_preprocess_anonymous_subscriptions_message(array &$v
8080
$variables['link'] = Link::fromTextAndUrl(t('Klik her for at gå til høringer og afgørelser'), Url::fromUserInput('/hoeringer-og-afgoerelser'));
8181
}
8282
}
83+
84+
/**
85+
* Implements hook_preprocess_HOOK().
86+
*/
87+
function fds_redwhite_theme_preprocess_paragraph(&$variables)
88+
{
89+
/** @var \Drupal\paragraphs\Entity\Paragraph $paragraph */
90+
$paragraph = $variables['paragraph'];
91+
92+
if ($paragraph->bundle() != 'os2web_banner_paragraph') {
93+
return;
94+
}
95+
96+
$breadcrumb_manager = Drupal::service('breadcrumb');
97+
$route_match = Drupal::service('current_route_match');
98+
$variables['breadcrumbs'] = $breadcrumb_manager->build($route_match)->toRenderable();
99+
}

web/themes/custom/fds_redwhite_theme/src/javascripts/app.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,45 @@ document.addEventListener('DOMContentLoaded', function() {
6262
}
6363
});
6464

65+
// Footer menu dropdowns.
66+
document.addEventListener('DOMContentLoaded', function() {
67+
function toggle(event) {
68+
var button = event.target;
69+
var parent = button.parentNode;
70+
var list = parent.querySelector('.menu');
71+
if (list) {
72+
list.classList.toggle('show');
73+
parent.classList.toggle('active');
74+
}
75+
}
76+
77+
var buttons = document.querySelectorAll('.footer .block-menu.navigation .menu-item--expanded');
78+
79+
for (var i = 0; i < buttons.length; i++) {
80+
var button = buttons[i];
81+
82+
button.addEventListener('click', toggle);
83+
}
84+
});
85+
86+
// Cover arrow adjustments.
87+
document.addEventListener('DOMContentLoaded', function() {
88+
var coverArrow = document.querySelector('.rk_cover_arrow_button_wrapper');
89+
90+
if (coverArrow) {
91+
coverArrow.parentNode.setAttribute('style', 'position: relative;');
92+
coverArrow.addEventListener('click', scroll);
93+
}
94+
95+
function scroll(event) {
96+
var scroll_to = jQuery(event.target)
97+
98+
jQuery([document.documentElement, document.body]).animate({
99+
scrollTop: scroll_to.offset().top - 200
100+
}, 1000);
101+
}
102+
});
103+
65104
// Open all file-links in a new window.
66105
(function() {
67106
var links = document.querySelectorAll('.field--type-file .file a');

web/themes/custom/fds_redwhite_theme/src/styles/theme/components/_breadcrumb.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@
4141

4242
color: $color-orange-004;
4343
}
44-
45-
&:first-child {
46-
display: none;
47-
}
48-
49-
&:nth-child(2) {
50-
51-
&:before {
52-
display: none;
53-
}
54-
}
5544
}
5645

5746
a {

web/themes/custom/fds_redwhite_theme/src/styles/theme/components/_custom-header.scss

Lines changed: 3 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -89,39 +89,13 @@
8989
background: linear-gradient(90deg, rgba(0,102,50,1) 0%, rgba(0,102,50,0.75) 50%, rgba(0,102,50,0) 100%);
9090
}
9191

92-
.path-frontpage {
93-
94-
&, &.toolbar-fixed {
95-
padding-top: 0 !important;
96-
97-
&:not(.gin--vertical-toolbar) {
98-
99-
&.toolbar-horizontal {
100-
padding-top: 39px !important;
101-
102-
&.toolbar-tray-open {
103-
padding-top: 79px !important;
104-
}
105-
}
106-
}
107-
}
108-
}
109-
11092
body {
111-
11293
&, &.toolbar-fixed {
11394
padding-top: 74px !important;
95+
}
11496

115-
&:not(.gin--vertical-toolbar) {
116-
117-
&.toolbar-horizontal {
118-
padding-top: 74px + 39px !important;
119-
120-
&.toolbar-tray-open {
121-
padding-top: 74px + 79px !important;
122-
}
123-
}
124-
}
97+
&.toolbar-tray-open {
98+
padding-top: 79px !important;
12599
}
126100
}
127101

@@ -158,28 +132,6 @@ body {
158132
}
159133
}
160134

161-
.custom-header--fixed {
162-
position: fixed;
163-
164-
top: 0;
165-
left: 0;
166-
right: 0;
167-
168-
z-index: 300;
169-
170-
.toolbar-horizontal:not(.gin--vertical-toolbar) {
171-
top: 39px;
172-
}
173-
174-
.toolbar-horizontal.toolbar-tray-open:not(.gin--vertical-toolbar) & {
175-
top: 79px; // Height of toolbar tray.
176-
}
177-
178-
.path-frontpage & {
179-
display: none;
180-
}
181-
}
182-
183135
.custom-header__button {
184136
padding: 10px; // For fat thumbs.
185137

@@ -462,25 +414,6 @@ body {
462414

463415
// Desktop - and up
464416
@include media-breakpoint-up(md) {
465-
466-
body {
467-
468-
&, &.toolbar-fixed {
469-
padding-top: 132px !important; // Height of .custom-header--fixed (recalculated by JS)
470-
471-
&:not(.gin--vertical-toolbar) {
472-
473-
&.toolbar-horizontal {
474-
padding-top: 132px + 39px !important;
475-
476-
&.toolbar-tray-open {
477-
padding-top: 132px + 79px !important;
478-
}
479-
}
480-
}
481-
}
482-
}
483-
484417
.custom-header {
485418

486419
.views-exposed-form {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{#
2+
/**
3+
* @file
4+
* Theme override for a breadcrumb trail.
5+
*
6+
* Available variables:
7+
* - breadcrumb: Breadcrumb trail items.
8+
*/
9+
#}
10+
{% if breadcrumb %}
11+
<nav role="navigation" aria-labelledby="system-breadcrumb">
12+
<h2 id="system-breadcrumb" class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
13+
14+
<ol class="breadcrumb">
15+
{% for item in breadcrumb %}
16+
<li>
17+
{% if item.url %}
18+
<a href="{{ item.url }}">{{ item.text }}</a>
19+
{% else %}
20+
{{ item.text }}
21+
{% endif %}
22+
</li> {% endfor %}
23+
</ol>
24+
</nav>
25+
{% endif %}

0 commit comments

Comments
 (0)