Skip to content

Commit

Permalink
Sticky nav on entry action button click
Browse files Browse the repository at this point in the history
  • Loading branch information
Simounet committed Jan 21, 2020
1 parent 996b2ec commit cfd77d1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions app/Resources/static/themes/material/css/nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ nav {
display: none;
}

.entry-nav-top--sticky {
position: sticky;
top: 0;
}

@media (min-width: 993px) {
.button-collapse {
display: none;
Expand Down
8 changes: 8 additions & 0 deletions app/Resources/static/themes/material/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ import './js/shortcuts/entry';
/* Theme style */
import './css/index.scss';

const stickyNav = () => {
const nav = $('.js-entry-nav-top');
$('[data-toggle="actions"]').click(() => {
nav.toggleClass('entry-nav-top--sticky');
});
};

$(document).ready(() => {
// sideNav
$('.button-collapse').sideNav();
Expand All @@ -36,6 +43,7 @@ $(document).ready(() => {
initFilters();
initExport();
initRandom();
stickyNav();

const toggleNav = (toShow, toFocus) => {
$('.nav-panel-actions').hide(100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="progress">
<div class="determinate"></div>
</div>
<nav class="hide-on-large-only">
<nav class="hide-on-large-only js-entry-nav-top">
<div class="nav-panel-item cyan darken-1">
<ul>
<li>
Expand Down Expand Up @@ -281,7 +281,7 @@
</article>

<div class="fixed-action-btn horizontal click-to-toggle hide-on-large-only">
<a class="btn-floating btn-large">
<a class="btn-floating btn-large" data-toggle="actions">
<i class="material-icons">menu</i>
</a>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion web/wallassets/material.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/wallassets/material.js

Large diffs are not rendered by default.

0 comments on commit cfd77d1

Please sign in to comment.