Activate Foundation's dropdowns after tab switch

If the dropdown doesn't exist during page load, Foundation misses it. We
need to initialise it again.
This commit is contained in:
Maikel Linke
2020-01-30 17:02:23 +11:00
parent 5e61ba8136
commit b63042236d

View File

@@ -29,11 +29,17 @@ Darkswarm.controller "ProductsCtrl", ($scope, $filter, $rootScope, Products, Ord
data.map( (taxon) ->
$scope.supplied_taxons[taxon.id] = Taxons.taxons_by_id[taxon.id]
)
# Some taxons may be displayed in a dropdown.
# Foundation needs initialising again to add dropdown actions.
Foundation.init()
OrderCycleResource.properties params, (data)=>
$scope.supplied_properties = {}
data.map( (property) ->
$scope.supplied_properties[property.id] = Properties.properties_by_id[property.id]
)
# Some properties may be displayed in a dropdown.
# Foundation needs initialising again to add dropdown actions.
Foundation.init()
$scope.loadMore = ->
if ($scope.page * $scope.per_page) <= Products.products.length