diff options
Diffstat (limited to 'js/directive/NewsFocus.js')
-rw-r--r-- | js/directive/NewsFocus.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/directive/NewsFocus.js b/js/directive/NewsFocus.js new file mode 100644 index 000000000..3ab2a85aa --- /dev/null +++ b/js/directive/NewsFocus.js @@ -0,0 +1,22 @@ +/** + * ownCloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Bernhard Posselt 2014 + */ +app.directive('newsFocus', ($timeout) => { + 'use strict'; + + return (scope, elem, attrs) => { + elem.click(() => { + let toReadd = $(attrs.newsFocus); + $timeout(() => { + toReadd.focus(); + }, 500); + }); + }; + +});
\ No newline at end of file |