Skip to content

Commit

Permalink
Merge pull request #306 from City-of-Helsinki/cookie-consent-fix
Browse files Browse the repository at this point in the history
fix: mobile view scroll auto
  • Loading branch information
jannetalvio committed Nov 8, 2023
2 parents ac59550 + 8b6cb91 commit 0963708
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
5 changes: 5 additions & 0 deletions hkm/static/hkm/css/consent.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
border-top: 8px solid #0000bf;
max-height: 80vh;
z-index: 2;
overflow: auto;
}

#cookie-consent__container {
Expand Down Expand Up @@ -84,6 +85,10 @@
gap: 8px;
}

.cookie-consent-table-container {
overflow-x: auto;
}

#consent-table {
border-collapse: collapse;
width: 100%;
Expand Down
10 changes: 5 additions & 5 deletions hkm/static/hkm/js/cookie-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
$readMoreBtn.hide();
$cookieContents.show();
});

$cookieConsentContainer.on('click', function (e) {
$readMoreBtn.hide();
$cookieContents.show();
});
}

$cookieConsentContainer.on('click', function (e) {
$readMoreBtn.hide();
$cookieContents.show();
});

$acceptBtn.on('click', function (e) {
if(_paq) {
_paq.push(['setCookieConsentGiven']);
Expand Down
34 changes: 18 additions & 16 deletions hkm/templates/hkm/snippets/cookie_consent.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,24 @@
<div class="cookie-consent__more-content__section">
<span>{% trans 'Matomo (optional)' %}</span>
<p>{% trans 'Matomo description' %}</p>
<table id="consent-table">
<thead>
<th>{% trans 'Cookie name' %}</th>
<th>{% trans 'Cookie set by' %}</th>
<th>{% trans 'Purpose of use' %}</th>
<th>{% trans 'Period of validity' %}</th>
</thead>
<tbody>
<tr>
<td>_pk*</td>
<td>digia.fi</td>
<td>{% trans 'A cookie of the Matomo statistics system' %}</td>
<td>393 {% trans 'Cookie days' %}</td>
</tr>
</tbody>
</table>
<div class="cookie-consent-table-container">
<table id="consent-table">
<thead>
<th>{% trans 'Cookie name' %}</th>
<th>{% trans 'Cookie set by' %}</th>
<th>{% trans 'Purpose of use' %}</th>
<th>{% trans 'Period of validity' %}</th>
</thead>
<tbody>
<tr>
<td>_pk*</td>
<td>digia.fi</td>
<td>{% trans 'A cookie of the Matomo statistics system' %}</td>
<td>393 {% trans 'Cookie days' %}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="cookie-consent__actions">
Expand Down

0 comments on commit 0963708

Please sign in to comment.