diff --git a/services/web/app/views/project/editor/review-panel.pug b/services/web/app/views/project/editor/review-panel.pug index 590c1a6776..43a854b591 100644 --- a/services/web/app/views/project/editor/review-panel.pug +++ b/services/web/app/views/project/editor/review-panel.pug @@ -49,6 +49,7 @@ on-reject="rejectChange(entry_id);" on-accept="acceptChange(entry_id);" on-indicator-click="toggleReviewPanel();" + on-body-click="gotoEntry(editor.open_doc_id, entry)" permissions="permissions" ) @@ -61,6 +62,7 @@ on-indicator-click="toggleReviewPanel();" on-save-edit="saveEdit(entry.thread_id, comment)" on-delete="deleteComment(entry.thread_id, comment)" + on-body-click="gotoEntry(editor.open_doc_id, entry)" permissions="permissions" ng-if="!reviewPanel.loadingThreads" ) @@ -190,7 +192,7 @@ script(type='text/ng-template', id='commentEntryTemplate') .rp-loading(ng-if="!threads[entry.thread_id].submitting && (!threads[entry.thread_id] || threads[entry.thread_id].messages.length == 0)") | No comments - div + .rp-comment-loaded .rp-comment( ng-repeat="comment in threads[entry.thread_id].messages track by comment.id" ) diff --git a/services/web/public/coffee/ide/review-panel/directives/changeEntry.coffee b/services/web/public/coffee/ide/review-panel/directives/changeEntry.coffee index 96f5e50016..9dc1ef2a37 100644 --- a/services/web/public/coffee/ide/review-panel/directives/changeEntry.coffee +++ b/services/web/public/coffee/ide/review-panel/directives/changeEntry.coffee @@ -11,11 +11,16 @@ define [ onAccept: "&" onReject: "&" onIndicatorClick: "&" + onBodyClick: "&" link: (scope, element, attrs) -> scope.contentLimit = 40 scope.isCollapsed = true scope.needsCollapsing = false + element.on "click", (e) -> + if $(e.target).is('.rp-entry, .rp-entry-description, .rp-entry-body, .rp-entry-action-icon i') + scope.onBodyClick() + scope.toggleCollapse = () -> scope.isCollapsed = !scope.isCollapsed $timeout () -> diff --git a/services/web/public/coffee/ide/review-panel/directives/commentEntry.coffee b/services/web/public/coffee/ide/review-panel/directives/commentEntry.coffee index 7c7811d553..b2f09c96af 100644 --- a/services/web/public/coffee/ide/review-panel/directives/commentEntry.coffee +++ b/services/web/public/coffee/ide/review-panel/directives/commentEntry.coffee @@ -13,10 +13,15 @@ define [ onIndicatorClick: "&" onSaveEdit: "&" onDelete: "&" + onBodyClick: "&" link: (scope, element, attrs) -> scope.state = animating: false + element.on "click", (e) -> + if $(e.target).is('.rp-entry, .rp-comment-loaded, .rp-comment-content, .rp-comment-reply, .rp-entry-metadata') + scope.onBodyClick() + scope.handleCommentReplyKeyPress = (ev) -> if ev.keyCode == 13 and !ev.shiftKey and !ev.ctrlKey and !ev.metaKey ev.preventDefault()