mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
Fix HashNavigation reload bug
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, Navigation, $location, $templateCache, CurrentHub, $http) ->
|
||||
Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, Navigation, $location, CurrentHub, $http, $timeout) ->
|
||||
$scope.shopfront_loading = false
|
||||
$scope.enterprise_details = []
|
||||
|
||||
$timeout ->
|
||||
if $scope.open()
|
||||
$scope.load_shopfront()
|
||||
|
||||
# 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) ->
|
||||
@@ -14,6 +18,9 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, Navigation, $locati
|
||||
$scope.toggle_tab(event)
|
||||
return
|
||||
|
||||
$scope.load_shopfront(event)
|
||||
|
||||
$scope.load_shopfront = (event=null) ->
|
||||
$scope.shopfront_loading = true
|
||||
$scope.toggle_tab(event)
|
||||
|
||||
@@ -26,7 +33,7 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, Navigation, $locati
|
||||
console.error(data)
|
||||
|
||||
$scope.toggle_tab = (event) ->
|
||||
HashNavigation.toggle $scope.hub.hash if !angular.element(event.target).inheritedData('is-link')
|
||||
HashNavigation.toggle $scope.hub.hash if event && !angular.element(event.target).inheritedData('is-link')
|
||||
|
||||
# Returns boolean: pulldown tab is currently open/closed
|
||||
$scope.open = ->
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll, $http) ->
|
||||
Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll, $http, $timeout) ->
|
||||
$scope.shopfront_loading = false
|
||||
$scope.enterprise_details = []
|
||||
|
||||
$timeout ->
|
||||
if $scope.open()
|
||||
$scope.load_shopfront()
|
||||
|
||||
# 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) ->
|
||||
@@ -14,6 +18,9 @@ Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll,
|
||||
$scope.toggle_tab(event)
|
||||
return
|
||||
|
||||
$scope.load_shopfront(event)
|
||||
|
||||
$scope.load_shopfront = (event=null) ->
|
||||
$scope.shopfront_loading = true
|
||||
$scope.toggle_tab(event)
|
||||
|
||||
@@ -26,7 +33,7 @@ Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll,
|
||||
console.error(data)
|
||||
|
||||
$scope.toggle_tab = (event) ->
|
||||
HashNavigation.toggle $scope.producer.hash if !angular.element(event.target).inheritedData('is-link')
|
||||
HashNavigation.toggle $scope.producer.hash if event && !angular.element(event.target).inheritedData('is-link')
|
||||
|
||||
$scope.open = ->
|
||||
HashNavigation.active($scope.producer.hash)
|
||||
|
||||
Reference in New Issue
Block a user