Close add-new webhook form when is needed

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

View File

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