Confirm leaving networks.

This commit is contained in:
Adam Ierymenko 2015-05-18 16:02:37 -07:00
parent 8c7a4efe1a
commit 992438f054
2 changed files with 14 additions and 12 deletions

View File

@ -4,17 +4,19 @@ var ZeroTierNetwork = React.createClass({
},
leaveNetwork: function(event) {
Ajax.call({
url: 'network/'+this.props.nwid+'?auth='+this.props.authToken,
cache: false,
type: 'DELETE',
success: function(data) {
if (this.props.onNetworkDeleted)
this.props.onNetworkDeleted(this.props.nwid);
}.bind(this),
error: function(error) {
}.bind(this)
});
if (confirm("Are you sure you want to leave this network?")) {
Ajax.call({
url: 'network/'+this.props.nwid+'?auth='+this.props.authToken,
cache: false,
type: 'DELETE',
success: function(data) {
if (this.props.onNetworkDeleted)
this.props.onNetworkDeleted(this.props.nwid);
}.bind(this),
error: function(error) {
}.bind(this)
});
}
event.preventDefault();
},

2
ui/ztui.min.js vendored

File diff suppressed because one or more lines are too long