From bdb4eab44a7bd4c818dce36ce8ce540cfa8cd580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Tue, 10 May 2016 09:36:02 +0200 Subject: [PATCH] Fix confirm on disabled edit mode lighbox in wiki pages --- app/coffee/modules/wiki/main.coffee | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/coffee/modules/wiki/main.coffee b/app/coffee/modules/wiki/main.coffee index db1c25fa..09b4e16d 100644 --- a/app/coffee/modules/wiki/main.coffee +++ b/app/coffee/modules/wiki/main.coffee @@ -292,12 +292,13 @@ EditableWikiContentDirective = ($window, $document, $repo, $confirm, $loading, $ $scope.$apply(cancelEdition) $el.on "keydown", "textarea", (event) -> - if event.keyCode == 27 - $scope.$applyAsync () -> - confirmTitle = $translate.instant("COMMON.CONFIRM_CLOSE_EDIT_MODE") - $confirm.ask(confirmTitle).then (askResponse) -> - cancelEdition() - askResponse.finish() + return if event.keyCode != 27 + $scope.$applyAsync () -> + title = $translate.instant("COMMON.CONFIRM_CLOSE_EDIT_MODE_TITLE") + message = $translate.instant("COMMON.CONFIRM_CLOSE_EDIT_MODE_MESSAGE") + $confirm.ask(title, null, message).then (askResponse) -> + cancelEdition() + askResponse.finish() $scope.$watch $attrs.ngModel, (wikiPage) -> return if not wikiPage