public-album: fix header (fix #627)

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/672/head
Varun Patil 2023-05-24 22:04:14 -07:00
parent ca30e2f876
commit 449595b006
2 changed files with 22 additions and 0 deletions

View File

@ -1,4 +1,18 @@
import { subscribe } from '@nextcloud/event-bus';
import { loadState } from '@nextcloud/initial-state';
// Shown in dynamic top matter (Timeline::viewName)
export const title = loadState('memories', 'share_title', '');
// Set up hook to monitor recycler scroll to show/hide header
if (title) {
const header = document.querySelector('header#header .header-appname') as HTMLElement;
let isHidden = false; // cache state to avoid unnecessary DOM updates
// Hide header when recycler is scrolled down
subscribe('memories.recycler.scroll', ({ current }: { current: number }) => {
const hidden = current < 80;
if (hidden === isHidden) return;
header.classList.toggle('hidden', (isHidden = hidden));
});
}

View File

@ -59,6 +59,14 @@ body.has-viewer header {
z-index: 0 !important;
}
// Allow hiding app name (PublicShareHeader)
header#header .header-appname {
transition: opacity 0.2s ease-in-out;
&.hidden {
opacity: 0 !important;
}
}
// Hide horizontal scrollbar on mobile
// For the padding removal above
#app-content-vue {