Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved removeNode action to pass through the original node, not onl… #1772

Merged
merged 1 commit into from
Apr 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/client/actions/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ function sortNode(node, order, sortLayers = null) {
};
}

function removeNode(node, type) {
function removeNode(node, type, properties) {
return {
type: REMOVE_NODE,
node: node,
nodeType: type
nodeType: type,
properties
};
}

Expand Down
2 changes: 1 addition & 1 deletion web/client/components/TOC/DefaultLayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var DefaultLayer = React.createClass({
};
},
onConfirmDelete() {
this.props.removeNode(this.props.node.id, "layers");
this.props.removeNode(this.props.node.id, "layers", this.props.node);
this.closeDeleteDialog();
},
getInitialState: function() {
Expand Down
7 changes: 5 additions & 2 deletions web/client/components/maps/modals/ConfirmModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
const React = require('react');
const {Button} = require('react-bootstrap');
const Modal = require('../../misc/Modal');
const Spinner = require('react-spinkit');

/**
* A Modal window to show a confirmation dialog
Expand All @@ -28,7 +29,8 @@ const ConfirmModal = React.createClass({
body: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.element]),
titleText: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.element]),
confirmText: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.element]),
cancelText: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.element])
cancelText: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.element]),
running: React.PropTypes.bool
},
getDefaultProps() {
return {
Expand All @@ -54,13 +56,14 @@ const ConfirmModal = React.createClass({
const footer = (<span role="footer"><div style={{"float": "left"}}></div>
<Button
ref="confirmButton"
disabled={this.props.running}
className={this.props.className}
key="confirmButton"
bsStyle="primary"
bsSize={this.props.buttonSize}
onClick={() => {
this.onConfirm();
}}>{this.props.confirmText}</Button>
}}>{this.props.running ? <Spinner spinnerName="circle" overrideSpinnerClassName="spinner" noFadeIn /> : null}{this.props.confirmText}</Button>
{this.props.includeCloseButton ? <Button
key="cancelButton"
ref="cancelButton"
Expand Down