Avoid opening tabs when navigating away from page

Fixes a long-standing mini bug that creates little javascript console errors. Also stops pointless requests being sent to the server.
This commit is contained in:
Matt-Yorkley
2021-08-02 08:07:15 +01:00
parent af7355a780
commit ab0866b57e
2 changed files with 4 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http,
# Toggles shopfront tabs open/closed. Fetches enterprise details from the api, diplays them and adds them
# to $scope.enterprise_details, or simply displays the details again if previously fetched
$scope.toggle = (event) ->
return if event.target.closest("a")
if $scope.open()
$scope.toggle_tab(event)
return

View File

@@ -9,6 +9,8 @@ Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll,
# Toggles shopfront tabs open/closed. Fetches enterprise details from the api, diplays them and adds them
# to $scope.enterprise_details, or simply displays the details again if previously fetched
$scope.toggle = (event) ->
return if event.target.closest("a")
if $scope.open()
$scope.toggle_tab(event)
return