diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-11 21:11:42 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-11 21:11:42 +0200 |
commit | 3e313821cf21e6443ab1b75336c8c510d758fa43 (patch) | |
tree | 0c2533226308322030548d11de107179288ebe77 /js/build/app.js | |
parent | f3091d84e14537a42334e66ea6588cf2b83f9ab6 (diff) |
fix autofocus
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/js/build/app.js b/js/build/app.js index 9fe66bf6f..c702120e8 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -1471,11 +1471,13 @@ app.directive('newsAudio', function () { app.directive('newsAutoFocus', function () { 'use strict'; return function (scope, elem, attrs) { - if (attrs.newsAutofocus) { - $(attrs.newsAutofocus).focus(); - } else { - elem.focus(); + var toFocus = elem; + + if (attrs.newsAutoFocus) { + toFocus = $(attrs.newsAutoFocus); } + + toFocus.focus(); }; }); app.directive('newsBindHtmlUnsafe', function () { |