mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
changed html autofocus to an angular directive
autofocus is html5y and worked on chrome but not firefox for me.
This commit is contained in:
parent
b15adefed7
commit
726719ce3f
3 changed files with 13 additions and 2 deletions
|
@ -20,7 +20,7 @@ block content
|
|||
placeholder='email@example.com',
|
||||
ng-model="email",
|
||||
ng-model-options="{ updateOn: 'blur' }",
|
||||
autofocus
|
||||
focus="true"
|
||||
)
|
||||
span.small.text-primary(ng-show="loginForm.email.$invalid && loginForm.email.$dirty")
|
||||
| Must be an email address
|
||||
|
|
|
@ -32,7 +32,7 @@ block content
|
|||
ng-model="email",
|
||||
ng-init="email = #{JSON.stringify(new_email)}",
|
||||
ng-model-options="{ updateOn: 'blur' }",
|
||||
autofocus
|
||||
focus="true"
|
||||
)
|
||||
span.small.text-primary(ng-show="registerForm.email.$invalid && registerForm.email.$dirty")
|
||||
| Must be an email address
|
||||
|
|
|
@ -55,6 +55,17 @@ define [
|
|||
selectName(element)
|
||||
}
|
||||
|
||||
|
||||
App.directive "focus", ($timeout) ->
|
||||
scope:
|
||||
trigger: "@focus"
|
||||
|
||||
link: (scope, element) ->
|
||||
scope.$watch "trigger", (value) ->
|
||||
if value is "true"
|
||||
$timeout ->
|
||||
element[0].focus()
|
||||
|
||||
selectName = (element) ->
|
||||
# Select up to last '.'. I.e. everything
|
||||
# except the file extension
|
||||
|
|
Loading…
Reference in a new issue