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