mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-03-08 22:24:48 -04:00
f
This commit is contained in:
@@ -1 +1 @@
|
|||||||
VERSION = "7.9g"
|
VERSION = "7.9h"
|
||||||
|
|||||||
@@ -656,41 +656,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.fixed-nav {
|
|
||||||
.profile-info-nav-wrap {
|
|
||||||
padding-bottom: $_authorPage-navHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
.profile-nav {
|
|
||||||
z-index: 3;
|
|
||||||
position: fixed;
|
|
||||||
top: var(--header-height);
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
|
|
||||||
@media screen and (min-width: 768px) {
|
|
||||||
.visible-sidebar & {
|
|
||||||
padding-left: var(--sidebar-width);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sliding-sidebar & {
|
|
||||||
transition-property: padding-left;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable sticky navigation when in select_media mode (for LTI iframe)
|
|
||||||
&.fixed-nav[data-action="select_media"] {
|
|
||||||
.profile-nav {
|
|
||||||
position: relative;
|
|
||||||
top: auto;
|
|
||||||
left: auto;
|
|
||||||
right: auto;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-main {
|
.page-main {
|
||||||
|
|||||||
@@ -623,12 +623,6 @@ export default function ProfilePagesHeader(props) {
|
|||||||
const profilePageHeaderRef = useRef(null);
|
const profilePageHeaderRef = useRef(null);
|
||||||
const profileNavRef = useRef(null);
|
const profileNavRef = useRef(null);
|
||||||
|
|
||||||
const [fixedNav, setFixedNav] = useState(false);
|
|
||||||
|
|
||||||
const positions = {
|
|
||||||
profileNavTop: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
const userIsAdmin = !MemberContext._currentValue.is.anonymous && MemberContext._currentValue.is.admin;
|
const userIsAdmin = !MemberContext._currentValue.is.anonymous && MemberContext._currentValue.is.admin;
|
||||||
const userIsAuthor =
|
const userIsAuthor =
|
||||||
!MemberContext._currentValue.is.anonymous &&
|
!MemberContext._currentValue.is.anonymous &&
|
||||||
@@ -640,18 +634,6 @@ export default function ProfilePagesHeader(props) {
|
|||||||
userIsAuthor ||
|
userIsAuthor ||
|
||||||
(!MemberContext._currentValue.is.anonymous && MemberContext._currentValue.can.deleteProfile);
|
(!MemberContext._currentValue.is.anonymous && MemberContext._currentValue.can.deleteProfile);
|
||||||
|
|
||||||
function updateProfileNavTopPosition() {
|
|
||||||
positions.profileHeaderTop = profilePageHeaderRef.current.offsetTop;
|
|
||||||
positions.profileNavTop =
|
|
||||||
positions.profileHeaderTop +
|
|
||||||
profilePageHeaderRef.current.offsetHeight -
|
|
||||||
profileNavRef.current.refs.tabsNav.offsetHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateFixedNavPosition() {
|
|
||||||
setFixedNav(positions.profileHeaderTop + window.scrollY > positions.profileNavTop);
|
|
||||||
}
|
|
||||||
|
|
||||||
function cancelProfileRemoval() {
|
function cancelProfileRemoval() {
|
||||||
popupContentRef.current.toggle();
|
popupContentRef.current.toggle();
|
||||||
}
|
}
|
||||||
@@ -686,44 +668,24 @@ export default function ProfilePagesHeader(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWindowResize() {
|
|
||||||
updateProfileNavTopPosition();
|
|
||||||
updateFixedNavPosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onWindowScroll() {
|
|
||||||
updateFixedNavPosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (userCanDeleteProfile) {
|
if (userCanDeleteProfile) {
|
||||||
ProfilePageStore.on('profile_delete', onProfileDelete);
|
ProfilePageStore.on('profile_delete', onProfileDelete);
|
||||||
ProfilePageStore.on('profile_delete_fail', onProfileDeleteFail);
|
ProfilePageStore.on('profile_delete_fail', onProfileDeleteFail);
|
||||||
}
|
}
|
||||||
|
|
||||||
PageStore.on('resize', onWindowResize);
|
|
||||||
PageStore.on('changed_page_sidebar_visibility', onWindowResize);
|
|
||||||
PageStore.on('window_scroll', onWindowScroll);
|
|
||||||
|
|
||||||
updateProfileNavTopPosition();
|
|
||||||
updateFixedNavPosition();
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
if (userCanDeleteProfile) {
|
if (userCanDeleteProfile) {
|
||||||
ProfilePageStore.removeListener('profile_delete', onProfileDelete);
|
ProfilePageStore.removeListener('profile_delete', onProfileDelete);
|
||||||
ProfilePageStore.removeListener('profile_delete_fail', onProfileDeleteFail);
|
ProfilePageStore.removeListener('profile_delete_fail', onProfileDeleteFail);
|
||||||
}
|
}
|
||||||
|
|
||||||
PageStore.removeListener('resize', onWindowResize);
|
|
||||||
PageStore.removeListener('changed_page_sidebar_visibility', onWindowResize);
|
|
||||||
PageStore.removeListener('window_scroll', onWindowScroll);
|
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={profilePageHeaderRef}
|
ref={profilePageHeaderRef}
|
||||||
className={'profile-page-header' + (fixedNav ? ' fixed-nav' : '')}
|
className={'profile-page-header'}
|
||||||
{...(isSelectMediaMode() ? { 'data-action': 'select_media' } : {})}
|
{...(isSelectMediaMode() ? { 'data-action': 'select_media' } : {})}
|
||||||
>
|
>
|
||||||
{!props.hideChannelBanner && (
|
{!props.hideChannelBanner && (
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user