Skip to content
Open
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
10 changes: 7 additions & 3 deletions app/assets/javascripts/stick-to-window-when-scrolling.js
Original file line number Diff line number Diff line change
Expand Up @@ -1024,10 +1024,14 @@
$el.css({
// element will be absolutely positioned so cannot rely on parent element for width
width: window.innerWidth + "px",
// padding-left must align the sticky element's content with the main content area.
// The element has CSS margin-left: -gutterHalf which, combined with left: 0 in fixed
// positioning, shifts the border-box 15px to the left of the viewport edge.
// We compensate by using the main element's actual left offset from the viewport
// (via getBoundingClientRect) plus twice the padding to account for both the
// main's own left padding and the element's negative margin offset.
"padding-left":
(window.innerWidth - (main.offsetWidth - mainPaddingLeft)) / 2 +
mainPaddingLeft +
"px",
main.getBoundingClientRect().left + 2 * mainPaddingLeft + "px",
});
};
stickAtBottom.stick = function (el) {
Expand Down
5 changes: 1 addition & 4 deletions app/templates/views/choose-account.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ <h2>
<div class="js-stick-at-bottom-when-scrolling">
{% if current_user.has_access_to_live_and_trial_mode_services %}
<div class="grid-row contain-floats">
<div class="md:w-1/4 float-left py-0 px-0 px-gutterHalf box-border">
&nbsp;
</div>
<div class="md:w-3/4 float-left py-0 px-0 px-gutterHalf box-border">
<div class="float-left py-0 px-gutterHalf box-border">
{% endif %}
<a href="{{ url_for('.add_service') }}" class="button button-secondary">{{ _('Add new service') }}</a>
{% if current_user.has_access_to_live_and_trial_mode_services %}
Expand Down
Loading