From aa5f1506b8a139e8273b515e79c931ebcf5fb992 Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Fri, 3 Mar 2017 22:20:07 +0200 Subject: [PATCH] Fix feedback widget to be visible only on the /listings page --- app/listings/listings.routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/listings/listings.routes.js b/app/listings/listings.routes.js index 03993bd86..9e3f117a2 100755 --- a/app/listings/listings.routes.js +++ b/app/listings/listings.routes.js @@ -17,8 +17,8 @@ import angular from 'angular' $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams, error) { if (toState.name !== 'listings') { // remove usersnap widget if not in listings page - var usersnapWidget = document.getElementById("us_report_button") - if (usersnapWidget) usersnapWidget.remove() + var usersnapWidget = document.querySelectorAll('div[id*="_report_button"]') + if (usersnapWidget && usersnapWidget[0]) usersnapWidget[0].remove() } }) }])