Skip to content

Commit

Permalink
EditTemplate buttons stick to top while scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco committed Dec 17, 2020
1 parent 7d92ccd commit ac382c7
Showing 1 changed file with 11 additions and 1 deletion.
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>

0 comments on commit ac382c7

Please sign in to comment.