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

View file

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

View file

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