Wire up new button with existing UI for adding comments.

This commit is contained in:
Paulo Reis 2017-03-20 11:18:29 +00:00
parent beac43741c
commit 2c2abc3cae
3 changed files with 8 additions and 1 deletions

View file

@ -8,7 +8,7 @@
a.rp-add-comment-btn(
href
ng-if="reviewPanel.entries[editor.open_doc_id]['add-comment'] != null"
ng-click="startNewComment();"
ng-click="addNewComment();"
)
i.fa.fa-comment
|  #{translate("add_comment")}

View file

@ -327,6 +327,10 @@ define [
$scope.$broadcast "change:reject", entry_id
event_tracking.sendMB "rp-change-rejected", { view: if $scope.ui.reviewPanelOpen then $scope.reviewPanel.subView else 'mini' }
$scope.addNewComment = () ->
$scope.$broadcast "comment:start_adding"
$scope.toggleReviewPanel()
$scope.startNewComment = () ->
$scope.$broadcast "comment:select_line"
$timeout () ->

View file

@ -15,6 +15,9 @@ define [
isAdding: false
content: ""
scope.$on "comment:start_adding", () ->
scope.startNewComment()
scope.startNewComment = () ->
scope.state.isAdding = true
scope.onStartNew()