parent
ca30e2f876
commit
449595b006
|
@ -1,4 +1,18 @@
|
||||||
|
import { subscribe } from '@nextcloud/event-bus';
|
||||||
import { loadState } from '@nextcloud/initial-state';
|
import { loadState } from '@nextcloud/initial-state';
|
||||||
|
|
||||||
// Shown in dynamic top matter (Timeline::viewName)
|
// Shown in dynamic top matter (Timeline::viewName)
|
||||||
export const title = loadState('memories', 'share_title', '');
|
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));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -59,6 +59,14 @@ body.has-viewer header {
|
||||||
z-index: 0 !important;
|
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
|
// Hide horizontal scrollbar on mobile
|
||||||
// For the padding removal above
|
// For the padding removal above
|
||||||
#app-content-vue {
|
#app-content-vue {
|
||||||
|
|
Loading…
Reference in New Issue