From b50b9ba9245d98a4552133db4e9d27de0f72fbe0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 5 Nov 2020 14:31:16 +0100 Subject: better nav --- .../frontend/app/views/viewer/nav/nav.parent.js | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'animism-align/frontend/app/views/viewer/nav/nav.parent.js') diff --git a/animism-align/frontend/app/views/viewer/nav/nav.parent.js b/animism-align/frontend/app/views/viewer/nav/nav.parent.js index 98598d0..a4c2aee 100644 --- a/animism-align/frontend/app/views/viewer/nav/nav.parent.js +++ b/animism-align/frontend/app/views/viewer/nav/nav.parent.js @@ -19,6 +19,7 @@ class NavParent extends Component { this.handleMouseLeave = this.handleMouseLeave.bind(this) this.handleMouseEnterNext = this.handleMouseEnterNext.bind(this) this.handleMouseLeaveNext = this.handleMouseLeaveNext.bind(this) + this.handleNavBarClick = this.handleNavBarClick.bind(this) this.goToNextSection = this.goToNextSection.bind(this) } handleMouseEnter(){ @@ -34,11 +35,18 @@ class NavParent extends Component { } handleMouseLeaveNext(){ this.setState({ hoveringNext: false, suppressHover: true, }) - setTimeout(() => { + clearTimeout(this.timeout) + this.timeout = setTimeout(() => { this.setState({ suppressHover: false }) }, 50) } - goToNextSection() { + handleNavBarClick(e) { + e && e.stopPropagation() + actions.viewer.toggleComponent('nav') + } + goToNextSection(e) { + e && e.preventDefault() + e && e.stopPropagation() const { viewer } = this.props if (viewer.nextSection) { actions.viewer.seekToSection(viewer.nextSection) @@ -54,9 +62,9 @@ class NavParent extends Component { if ((this.state.hoveringNext || (viewer.atEndOfSection && !playing)) && !viewer.nav && viewer.nextSection) containerClassName += ' hovering-next' return (
-
+
- actions.viewer.toggleComponent('nav')}> + {viewer.currentSection && ( viewer.mediaTitle @@ -72,11 +80,13 @@ class NavParent extends Component {
-
+
{viewer.nextSection ? "Next" -- cgit v1.2.3-70-g09d2