Focus on text area when adding a comment

This commit is contained in:
James Allen 2017-01-16 15:17:56 +01:00
parent 278bfc1f50
commit e5c96eb619
2 changed files with 3 additions and 0 deletions

View file

@ -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();")

View file

@ -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