From 4f4ea8416c604ea6b938261799a2e15e0b64a670 Mon Sep 17 00:00:00 2001 From: Lucas Torroba Date: Fri, 4 Mar 2016 13:16:37 -0300 Subject: [PATCH] Closed issue #6758 After some discussion on the thread, this is probably the neatest solution to issue #6758. I have also modified the code on the guild controller, which displayed the very same problem when pressing the 'Leave' button to leave a guild. --- website/public/js/controllers/guildsCtrl.js | 2 +- website/public/js/controllers/partyCtrl.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/public/js/controllers/guildsCtrl.js b/website/public/js/controllers/guildsCtrl.js index 4c9259eaf8..df6b001448 100644 --- a/website/public/js/controllers/guildsCtrl.js +++ b/website/public/js/controllers/guildsCtrl.js @@ -54,7 +54,7 @@ habitrpg.controller("GuildsCtrl", ['$scope', 'Groups', 'User', 'Challenges', '$r $scope.clickLeave = function(group, $event){ $scope.selectedGroup = group; - $scope.popoverEl = $($event.target); + $scope.popoverEl = $($event.target).closest('.btn'); var html, title; Challenges.Challenge.query(function(challenges) { challenges = _.pluck(_.filter(challenges, function(c) { diff --git a/website/public/js/controllers/partyCtrl.js b/website/public/js/controllers/partyCtrl.js index cb53ac3eb5..ea0f3fa8bd 100644 --- a/website/public/js/controllers/partyCtrl.js +++ b/website/public/js/controllers/partyCtrl.js @@ -50,7 +50,7 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User',' $scope.clickLeave = function(group, $event){ Analytics.track({'hitType':'event','eventCategory':'button','eventAction':'click','eventLabel':'Leave Party'}); $scope.selectedGroup = group; - $scope.popoverEl = $($event.target); + $scope.popoverEl = $($event.target).closest('.btn'); var html, title; Challenges.Challenge.query(function(challenges) { challenges = _.pluck(_.filter(challenges, function(c) {