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

EditTemplate buttons stick to top while scrolling #8058

Merged
merged 1 commit into from
Dec 17, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ else
<span class="hint">@T["The Liquid template."]</span>
</div>

<div class="form-group">
<div class="form-group position-sticky action-bar">
<div class="btn-group">
<button type="submit" name="submit" class="btn btn-primary save">@T["Save"]</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-reference="parent" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down Expand Up @@ -79,5 +79,15 @@ else
initializeTemplatePreview(
document.getElementById('@Html.IdFor(x => x.Name)'),
document.getElementById('@Html.IdFor(x => x.Content)'));

$(window).scroll(function (e) {
var $actionsBar = $('.action-bar');
if ($(this).scrollTop() > 200) {
$actionsBar.attr('style', 'position: fixed !important');
}
else {
$actionsBar.attr('style', 'position: static !important');
}
});
});
</script>