Merge pull request #203 from taigaio/bug/1731/cancel-edition
fix cancel edition in wysiwyg & subjectsstable
commit
947ac85669
|
@ -544,7 +544,8 @@ EditableSubjectDirective = ($rootscope, $repo, $confirm, $loading, $qqueue) ->
|
|||
subject = $scope.item.subject
|
||||
save(subject)
|
||||
else if event.keyCode == 27
|
||||
$model.$modelValue.revert()
|
||||
$scope.$apply () => $model.$modelValue.revert()
|
||||
|
||||
$el.find('div.edit-subject').hide()
|
||||
$el.find('div.view-subject').show()
|
||||
|
||||
|
@ -649,9 +650,9 @@ EditableDescriptionDirective = ($rootscope, $repo, $confirm, $compile, $loading,
|
|||
description = $scope.item.description
|
||||
save(description)
|
||||
|
||||
$el.on "keyup", "textarea", (event) ->
|
||||
$el.on "keydown", "textarea", (event) ->
|
||||
if event.keyCode == 27
|
||||
$scope.item.revert()
|
||||
$scope.$apply () => $scope.item.revert()
|
||||
$el.find('.edit-description').hide()
|
||||
$el.find('.view-description').show()
|
||||
|
||||
|
|
|
@ -251,8 +251,10 @@ EditableWikiContentDirective = ($window, $document, $repo, $confirm, $loading, $
|
|||
$el.find(".edit-wiki-content").remove()
|
||||
|
||||
cancelEdition = ->
|
||||
return if !$scope.wiki.html
|
||||
|
||||
if $scope.wiki.id
|
||||
$scope.wiki.revert()
|
||||
$scope.$apply () => $scope.wiki.revert()
|
||||
switchToReadMode()
|
||||
else
|
||||
ctx = {project: $scope.projectSlug}
|
||||
|
@ -303,7 +305,7 @@ EditableWikiContentDirective = ($window, $document, $repo, $confirm, $loading, $
|
|||
$el.on "click", ".cancel", ->
|
||||
cancelEdition()
|
||||
|
||||
$el.on "keyup", "textarea", (event) ->
|
||||
$el.on "keydown", "textarea", (event) ->
|
||||
if event.keyCode == 27
|
||||
cancelEdition()
|
||||
|
||||
|
|
Loading…
Reference in New Issue