From 2c3209592404574cf1eeabbbc676ed9f21eee896 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Wed, 18 Sep 2013 20:09:35 +0200 Subject: [PATCH] confirmation when leaving party or guilds, fix #866 --- public/js/controllers/groupsCtrl.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/js/controllers/groupsCtrl.js b/public/js/controllers/groupsCtrl.js index 2d8645c4d5..032aaaf39c 100644 --- a/public/js/controllers/groupsCtrl.js +++ b/public/js/controllers/groupsCtrl.js @@ -143,6 +143,9 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A } $scope.leave = function(group){ + if (confirm("Are you sure you want to delete this guild?") !== true) { + return; + } group.$leave(); // var i = _.find($scope.groups.guilds, {_id:group._id}); // if (~i) $scope.groups.guilds.splice(i, 1); @@ -179,6 +182,9 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A }); } $scope.leave = function(group){ + if (confirm("Are you sure you want to leave this party?") !== true) { + return; + } group.$leave(function(){ Groups.groups.party = new Groups.Group(); });