diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-12 19:40:16 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-12 19:40:16 +0200 |
commit | b86a5591667ca8de3a83ef5bcbc756e356979b5a (patch) | |
tree | 4e364688193ab00a015301659e126ba2c6397a55 /js/directive | |
parent | 748500380e39880e54ee73ebaf5234ddf442e149 (diff) |
adding feeds and folders, lady and gentlemen :P
Diffstat (limited to 'js/directive')
-rw-r--r-- | js/directive/NewsAutoFocus.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/js/directive/NewsAutoFocus.js b/js/directive/NewsAutoFocus.js index 02edb0efa..0fa4a77c7 100644 --- a/js/directive/NewsAutoFocus.js +++ b/js/directive/NewsAutoFocus.js @@ -7,7 +7,7 @@ * @author Bernhard Posselt <dev@bernhard-posselt.com> * @copyright Bernhard Posselt 2014 */ -app.directive('newsAutoFocus', function () { +app.directive('newsAutoFocus', function ($timeout) { 'use strict'; return function (scope, elem, attrs) { var toFocus = elem; @@ -16,6 +16,9 @@ app.directive('newsAutoFocus', function () { toFocus = $(attrs.newsAutoFocus); } - toFocus.focus(); + // to combat $digest already in process error when route changes + $timeout(function () { + toFocus.focus(); + }, 0); }; });
\ No newline at end of file |