Merge pull request #1023 from taigaio/issue/4246/autofocus

autofocus directive
stable
Alejandro 2016-05-26 08:12:03 +02:00
commit 5f435ff882
2 changed files with 10 additions and 1 deletions

View File

@ -386,3 +386,12 @@ Svg = () ->
}
module.directive("tgSvg", [Svg])
Autofocus = ($timeout) ->
return {
restrict: 'A',
link : ($scope, $element) ->
$timeout -> $element[0].focus()
}
module.directive('tgAutofocus', ['$timeout', Autofocus])

View File

@ -1,6 +1,6 @@
.row.single-related-task.related-task-create-form.active(ng-if="openNewRelatedTask")
.task-name
input(type='text', autofocus, placeholder="{{'TASK.PLACEHOLDER_SUBJECT' | translate}}")
input(type='text', tg-autofocus, placeholder="{{'TASK.PLACEHOLDER_SUBJECT' | translate}}")
.task-settings
a.save-task(ng-click="save()" title="{{'COMMON.SAVE' | translate}}")
tg-svg(svg-icon="icon-save")