summaryrefslogtreecommitdiffstats
path: root/js-old/directive/NewsFocus.js
diff options
context:
space:
mode:
Diffstat (limited to 'js-old/directive/NewsFocus.js')
-rw-r--r--js-old/directive/NewsFocus.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js-old/directive/NewsFocus.js b/js-old/directive/NewsFocus.js
new file mode 100644
index 000000000..1ffdf72f0
--- /dev/null
+++ b/js-old/directive/NewsFocus.js
@@ -0,0 +1,22 @@
+/**
+ * Nextcloud - 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', function ($timeout, $interpolate) {
+ 'use strict';
+
+ return function (scope, elem, attrs) {
+ elem.click(function () {
+ var toReadd = $($interpolate(attrs.newsFocus)(scope));
+ $timeout(function () {
+ toReadd.focus();
+ }, 500);
+ });
+ };
+
+}); \ No newline at end of file