Interactive interface for browsing global, full-resolution satellite imagery
make measure menu items larger when button is opened via a touch event
Jason Kent38d275dc8ee1
diff --git a/web/css/measure.css b/web/css/measure.cssindex 99c657269..7e973fb67 100644--- a/web/css/measure.css+++ b/web/css/measure.css@@ -10,9 +10,9 @@right: 10px;bottom: 151px;& .modal-body {- padding: 5px 0 0;+ padding: 8px 0 0;& div {- padding: 0 5px 8px 10px;+ padding: 0 5px 10px 10px;& .form-check-label {margin-left: 24px;}@@ -43,7 +43,7 @@border-color: #fff;}& .custom-control-label {- margin-left: 34px;+ margin-left: 30px;&::before {background-color: #007bff;top: 1px;diff --git a/web/js/components/measure-tool/measure-button.js b/web/js/components/measure-tool/measure-button.jsindex 91c63e098..a0bf4e8e9 100644--- a/web/js/components/measure-tool/measure-button.js+++ b/web/js/components/measure-tool/measure-button.js@@ -12,7 +12,7 @@ const MEASURE_MENU_PROPS = {modalClassName: 'measure-tool-modal toolbar-modal',backdrop: false,bodyComponent: MeasureMenu,- clickType: null,+ touchDevice: false,wrapClassName: 'toolbar_modal_outer'};@@ -32,12 +32,13 @@ class MeasureButton extends React.Component {onButtonClick (evt) {const { openModal } = this.props;- MEASURE_MENU_PROPS.clickType = evt.type;+ const isTouchDevice = evt.type === 'touchend';evt.stopPropagation();evt.preventDefault();+ MEASURE_MENU_PROPS.touchDevice = isTouchDevice;openModal('MEASURE_MENU', MEASURE_MENU_PROPS);this.setState({- isTouchDevice: evt.type === 'touchend',+ isTouchDevice,showAlert: true});}@@ -76,8 +77,7 @@ class MeasureButton extends React.Component {const mapStateToProps = (state, ownProps) => {return {- isActive: state.measure.isActive,- browser: state.browser+ isActive: state.measure.isActive};};const mapDispatchToProps = dispatch => ({@@ -92,7 +92,6 @@ export default connect()(MeasureButton);MeasureButton.propTypes = {- browser: PropTypes.object,isActive: PropTypes.bool,openModal: PropTypes.func};diff --git a/web/js/components/measure-tool/measure-menu.js b/web/js/components/measure-tool/measure-menu.jsindex 51f066cf1..c839f830e 100644--- a/web/js/components/measure-tool/measure-menu.js+++ b/web/js/components/measure-tool/measure-menu.js@@ -63,10 +63,8 @@ class MeasureMenu extends Component {}render() {- // // const { clickType } = this.props;- // // const { showAlert } = this.state;- // const isMobile = true; // clickType === 'touchend';-+ const { isTouchDevice } = this.props;+ const listSize = isTouchDevice ? 'medium' : 'small';return (<><Form>@@ -105,7 +103,7 @@ class MeasureMenu extends Component {<IconListlist={OPTIONS_ARRAY}onClick={this.triggerEvent.bind(this)}- size="small"+ size={listSize}/></>);@@ -114,8 +112,7 @@ class MeasureMenu extends Component {const mapStateToProps = (state, ownProps) => {return {- clickType: state.modal.customProps.clickType,- isMobile: state.browser.lessThan.medium,+ isTouchDevice: state.modal.customProps.touchDevice,map: state.map,units: state.measure.units,useGreatCircleMeasurements: state.measure.useGreatCircleMeasurements@@ -139,12 +136,11 @@ export default connect()(MeasureMenu);MeasureMenu.propTypes = {- clickType: PropTypes.string,+ isTouchDevice: PropTypes.bool,map: PropTypes.object,onCloseModal: PropTypes.func,onToggleUnits: PropTypes.func,onToggleUseGreatCircle: PropTypes.func,-units: PropTypes.string,useGreatCircleMeasurements: PropTypes.bool};