From 67b1d04c1826cad15baa53572cc75653865dfa1b Mon Sep 17 00:00:00 2001 From: Jack Reed <mejackreed@users.noreply.github.com> Date: Mon, 9 Nov 2020 12:07:33 -0700 Subject: [PATCH] Adds setting to remove ThumbnailNavigation from WindowTopMenu fixes #3312 (#3338) --- src/components/WindowTopMenu.js | 8 ++++++-- src/config/settings.js | 1 + src/containers/WindowTopMenu.js | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/WindowTopMenu.js b/src/components/WindowTopMenu.js index 502346cbe..799875382 100644 --- a/src/components/WindowTopMenu.js +++ b/src/components/WindowTopMenu.js @@ -27,7 +27,8 @@ export class WindowTopMenu extends Component { */ render() { const { - containerId, handleClose, anchorEl, toggleDraggingEnabled, windowId, + containerId, handleClose, anchorEl, showThumbnailNavigationSettings, + toggleDraggingEnabled, windowId, } = this.props; return ( @@ -51,7 +52,8 @@ export class WindowTopMenu extends Component { orientation="horizontal" > <WindowViewSettings windowId={windowId} handleClose={handleClose} /> - <WindowThumbnailSettings windowId={windowId} handleClose={handleClose} /> + {showThumbnailNavigationSettings + && <WindowThumbnailSettings windowId={windowId} handleClose={handleClose} />} <PluginHookWithHeader {...this.props} /> </Menu> ); @@ -62,10 +64,12 @@ WindowTopMenu.propTypes = { anchorEl: PropTypes.object, // eslint-disable-line react/forbid-prop-types containerId: PropTypes.string.isRequired, handleClose: PropTypes.func.isRequired, + showThumbnailNavigationSettings: PropTypes.bool, toggleDraggingEnabled: PropTypes.func.isRequired, windowId: PropTypes.string.isRequired, }; WindowTopMenu.defaultProps = { anchorEl: null, + showThumbnailNavigationSettings: true, }; diff --git a/src/config/settings.js b/src/config/settings.js index 1a72af019..414de4734 100644 --- a/src/config/settings.js +++ b/src/config/settings.js @@ -297,6 +297,7 @@ export default { ], thumbnailNavigation: { defaultPosition: 'off', // Which position for the thumbnail navigation to be be displayed. Other possible values are "far-bottom" or "far-right" + displaySettings: true, // Display the settings for this in WindowTopMenu height: 130, // height of entire ThumbnailNavigation area when position is "far-bottom" width: 100, // width of one canvas (doubled for book view) in ThumbnailNavigation area when position is "far-right" }, diff --git a/src/containers/WindowTopMenu.js b/src/containers/WindowTopMenu.js index 7fcf1d644..f042c1f73 100644 --- a/src/containers/WindowTopMenu.js +++ b/src/containers/WindowTopMenu.js @@ -4,7 +4,7 @@ import { withTranslation } from 'react-i18next'; import { withPlugins } from '../extend/withPlugins'; import * as actions from '../state/actions'; import { WindowTopMenu } from '../components/WindowTopMenu'; -import { getContainerId } from '../state/selectors'; +import { getConfig, getContainerId } from '../state/selectors'; /** * mapStateToProps - to hook up connect @@ -13,6 +13,7 @@ import { getContainerId } from '../state/selectors'; */ const mapStateToProps = state => ({ containerId: getContainerId(state), + showThumbnailNavigationSettings: getConfig(state).thumbnailNavigation.displaySettings, }); /** -- GitLab