Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

make dialog draggable #2420

Benjamin Kinga41db1287974
diff --git a/web/css/vectorMeta.css b/web/css/vectorMeta.css
index d669faabe..16a5800dd 100644
--- a/web/css/vectorMeta.css
+++ b/web/css/vectorMeta.css
@@ -31,6 +31,7 @@
}
.vector-modal .modal-header {
padding-bottom: 0;
+ cursor: move;
}
.vector-modal .nav-item.active {
background: #f8f9fa;
diff --git a/web/js/components/vector-metadata/table.js b/web/js/components/vector-metadata/table.js
index 9de3deb4c..87731335a 100644
--- a/web/js/components/vector-metadata/table.js
+++ b/web/js/components/vector-metadata/table.js
@@ -13,7 +13,8 @@ export default class VectorMetaTable extends React.Component {
}
shouldComponentUpdate(nextProps) {
- if (this.props.id && nextProps.id && this.props.id === nextProps.id) {
+ const { id, title } = this.props;
+ if (id && title && nextProps.id && nextProps.title && this.props.id === nextProps.id && title === nextProps.title) {
return false;
} else {
return true;
diff --git a/web/js/containers/map-interactions.js b/web/js/containers/map-interactions.js
index 9b840d1d4..9ca46ef9d 100644
--- a/web/js/containers/map-interactions.js
+++ b/web/js/containers/map-interactions.js
@@ -94,6 +94,7 @@ const mapDispatchToProps = dispatch => ({
modalClassName: 'vector-modal light',
CompletelyCustomModal: vectorDialog,
isResizable: true,
+ dragHandle: '.modal-header',
dialogKey: new Date().getUTCMilliseconds(),
vectorMetaObject: lodashGroupBy(metaArray, 'id'),
width: 445,
diff --git a/web/js/containers/modal.js b/web/js/containers/modal.js
index 5a20af6c0..09f9b32e9 100644
--- a/web/js/containers/modal.js
+++ b/web/js/containers/modal.js
@@ -99,7 +99,8 @@ class ModalContainer extends Component {
desktopOnly,
size,
isDraggable,
- isResizable
+ isResizable,
+ dragHandle
} = newProps;
const style = this.getStyle();
@@ -117,7 +118,7 @@ class ModalContainer extends Component {
condition={isDraggable || isResizable}
wrapper={children =>
<Draggable
- handle=".draggable-modal-content"
+ handle={dragHandle}
disabled={!isDraggable}
>
<Resizable className="resize-box" resizeHandles={['se']}