[Backport] Close add-new webhook form when is needed

stable
David Barragán Merino 2016-03-21 13:17:14 +01:00
parent 7dca639e87
commit a0ce57f5f8
1 changed files with 4 additions and 0 deletions

View File

@ -277,6 +277,10 @@ NewWebhookDirective = ($rs, $repo, $confirm, $loading) ->
$scope.$apply ->
initializeNewValue()
# Close form if there some webhooks created
if $scope.webhooks.length >= 1
formDOMNode.addClass("hidden")
addWebhookDOMNode.on "click", (event) ->
formDOMNode.removeClass("hidden")
formDOMNode.find("input")[0].focus()