User story edit lightbox, on close revert changes of us

stable
Jesús Espino 2014-11-05 13:19:36 +01:00
parent b76a844346
commit c828791e7c
1 changed files with 13 additions and 0 deletions

View File

@ -314,6 +314,19 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
if data._error_message
$confirm.notify("error", data._error_message)
$el.on "click", ".close", (event) ->
event.preventDefault()
$scope.$apply ->
$scope.us.revert()
lightboxService.close($el)
$el.keydown (event) ->
code = if event.keyCode then event.keyCode else event.which
if code == 27
lightboxService.close($el)
$scope.$apply ->
$scope.us.revert()
$scope.$on "$destroy", ->
$el.off()