diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-05-18 16:02:37 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-05-18 16:02:37 -0700 |
commit | 992438f0546ed4b005745cc0982a6c6e7d8f7637 (patch) | |
tree | 9e84b389c5584ab7ac4c3468055c6f615d5c4a55 /ui/ZeroTierNetwork.jsx | |
parent | 8c7a4efe1a0b1f0c0c0be200a671d7113644bf54 (diff) | |
download | infinitytier-992438f0546ed4b005745cc0982a6c6e7d8f7637.tar.gz infinitytier-992438f0546ed4b005745cc0982a6c6e7d8f7637.zip |
Confirm leaving networks.
Diffstat (limited to 'ui/ZeroTierNetwork.jsx')
-rw-r--r-- | ui/ZeroTierNetwork.jsx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/ui/ZeroTierNetwork.jsx b/ui/ZeroTierNetwork.jsx index f842d758..4b37d888 100644 --- a/ui/ZeroTierNetwork.jsx +++ b/ui/ZeroTierNetwork.jsx @@ -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(); }, |