From 9bbeec0c3c2f2600c3585d9d6e4f3396e416a96b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 20 Nov 2020 18:09:48 +0100 Subject: mobile footer ui --- .../frontend/app/views/viewer/nav/nav.parent.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 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 f1ae01e..3fc2678 100644 --- a/animism-align/frontend/app/views/viewer/nav/nav.parent.js +++ b/animism-align/frontend/app/views/viewer/nav/nav.parent.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux' import actions from 'app/actions' import { ROMAN_NUMERALS } from 'app/constants' +import { isMobile } from 'app/utils' import { Arrow } from './viewer.icons' import NavPlayer from './nav.player' import { thumbnailURL, sectionProgressPercentage, sectionOffsetSeconds } from 'app/utils/annotation.utils' @@ -53,14 +54,18 @@ class NavParent extends Component { } handleNavBarClick(e) { e && e.stopPropagation() - // console.log('>> CLICK NAV') - // actions.viewer.toggleComponent('nav') - const percent = (e.pageX / this.navbarRef.current.offsetWidth) - const seconds = sectionOffsetSeconds(this.props.currentSection, percent) - console.log(e.pageX, this.navbarRef.current.offsetWidth, percent) - console.log(this.props.currentSection) - console.log(">>", seconds) - actions.viewer.seekToTimestamp(seconds) + if (isMobile) { + actions.viewer.toggleComponent('nav') + } else { + // console.log('>> CLICK NAV') + // actions.viewer.toggleComponent('nav') + const percent = (e.pageX / this.navbarRef.current.offsetWidth) + const seconds = sectionOffsetSeconds(this.props.currentSection, percent) + console.log(e.pageX, this.navbarRef.current.offsetWidth, percent) + console.log(this.props.currentSection) + console.log(">>", seconds) + actions.viewer.seekToTimestamp(seconds) + } } handleSectionLinkClick(e) { e && e.stopPropagation() -- cgit v1.2.3-70-g09d2