aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZarino Zappia <mail@zarino.co.uk>2018-05-08 09:37:44 +0100
committerZarino Zappia <mail@zarino.co.uk>2018-05-08 10:10:13 +0100
commit3df63585a96b43de6295a39ec8dbf0ea64626983 (patch)
tree914ce389b13b48075ec60b19a6a843a71e2b122b
parentb78032651996f8326c73b6e7ff8280776aa1cc40 (diff)
Simplify .internal-link-fixed-header positioning
Since #map_sidebar no longer disappears behind #site_header, there is no need for .internal-link-fixed-header to compensate for the height of the header. Just an arbitrary 2em offset is enough to prevent it butting up against the top of the #map_sidebar scrollable element. Meanwhile, moving the .internal-link-fixed-header anchor element to the top of its parent list item means it no longer has to compensate for the height of the moderation form elements, because those elements (indeed, the entire list item <form>) now comes *after* the anchor. Fixes mysociety/fixmystreet-commercial#1027.
-rw-r--r--CHANGELOG.md1
-rw-r--r--templates/web/base/report/update.html2
-rw-r--r--web/cobrands/sass/_layout.scss9
3 files changed, 4 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9432566db..bfdbe4549 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,6 +24,7 @@
- Cobrands hook to remove phone number field. #2049
- Check recent reports for any hidden since cached. #2053
- Asset layer attribution automatically shown. #2061
+ - The .internal-link-fixed-header positioning is now much simpler. #2117
- Bugfixes:
- Stop asset layers obscuring marker layer. #1999
- Don't delete hidden field values when inspecting reports. #1999
diff --git a/templates/web/base/report/update.html b/templates/web/base/report/update.html
index bd66c7b13..4dd12cf5e 100644
--- a/templates/web/base/report/update.html
+++ b/templates/web/base/report/update.html
@@ -4,6 +4,7 @@
<ul class="item-list item-list--updates">
[% END %]
<li class="item-list__item item-list__item--updates">
+ <a name="update_[% update.id %]" class="internal-link-fixed-header"></a>
[% IF permissions.moderate; original_update = update.moderation_original_data %]
<form method="post" action="/moderate/report/[% problem.id %]/update/[% update.id %]">
<input type="hidden" name="token" value="[% csrf_token %]">
@@ -25,7 +26,6 @@
<p class="meta-2">[% INCLUDE meta_line %]</p>
</div>
[% ELSE %]
- <a name="update_[% update.id %]" class="internal-link-fixed-header"></a>
[% INCLUDE 'report/photo.html' object=update %]
<div class="item-list__update-text">
<div class="moderate-display">
diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss
index e996dd123..13c2dff72 100644
--- a/web/cobrands/sass/_layout.scss
+++ b/web/cobrands/sass/_layout.scss
@@ -13,13 +13,8 @@ $header-top-border: $header-top-border-width solid $primary !default;
.internal-link-fixed-header {
display: block;
- @if unit($mappage-header-height) == 'em' {
- padding-top: $mappage-header-height + 1em;
- margin-top: -($mappage-header-height + 1em);
- } @else {
- padding-top: $mappage-header-height + 16px;
- margin-top: -($mappage-header-height + 16px);
- }
+ position: relative;
+ top: -2em;
}
//hacks for desk/mob only stuff