Prevent accordion controllers from showing missing nextPanel

Resolves this issue:
https://travis-ci.org/oeoeaio/openfoodnetwork/jobs/273323915
This commit is contained in:
Rob Harrington
2017-09-11 11:07:27 +10:00
parent 2c65218ce3
commit 4c238748c6
2 changed files with 4 additions and 2 deletions

View File

@@ -13,8 +13,9 @@ Darkswarm.controller "AccordionCtrl", ($scope, localStorageService, $timeout, $d
# scroll location is closed by show(), scrollTo() will scroll to the old location of
# the element. Putting this in a 50 ms timeout is enough delay for the DOM to
# have updated.
$timeout (->
$document.scrollTo $("##{section}"), offset_height, 500), 50
$timeout ->
$document.scrollTo($("##{section}"), offset_height, 500)
, 50
$scope.$on 'purchaseFormInvalid', (event, form) ->
# Scroll to first invalid section

View File

@@ -1,6 +1,7 @@
window.FieldsetMixin = ($scope)->
$scope.next = (event = false)->
event.preventDefault() if event
return unless $scope.nextPanel
$scope.show $scope.nextPanel
$scope.onTimeout = ->