Procházet zdrojové kódy

Focus on text area when adding a comment

James Allen před 9 roky
rodič
revize
e5c96eb619

+ 1 - 0
services/web/app/views/project/editor/review-panel.jade

@@ -273,6 +273,7 @@ script(type='text/ng-template', id='addCommentEntryTemplate')
 						ng-model="state.content"
 						ng-keypress="handleCommentKeyPress($event);"
 						placeholder="Add your comment here"
+						focus-on="comment:new:open"
 					)
 				.rp-entry-actions
 					a.rp-entry-button(href, ng-click="cancelNewComment();") 

+ 2 - 0
services/web/public/coffee/ide/review-panel/directives/addCommentEntry.coffee

@@ -17,6 +17,8 @@ define [
 			scope.startNewComment = () ->
 				scope.state.isAdding = true
 				scope.onStartNew()
+				setTimeout () ->
+					scope.$broadcast "comment:new:open"
 
 			scope.cancelNewComment = () ->
 				scope.state.isAdding = false