From c828791e7ce6fca7f56c23647137190d11063211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 5 Nov 2014 13:19:36 +0100 Subject: [PATCH] User story edit lightbox, on close revert changes of us --- app/coffee/modules/common/lightboxes.coffee | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/coffee/modules/common/lightboxes.coffee b/app/coffee/modules/common/lightboxes.coffee index eb9f1512..8c7905dd 100644 --- a/app/coffee/modules/common/lightboxes.coffee +++ b/app/coffee/modules/common/lightboxes.coffee @@ -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()