diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-31 03:00:15 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-31 03:00:15 +0200 |
commit | b5e4dd0ee565058c63d3df25fcebf352149e8158 (patch) | |
tree | 5d4c4f2a8fdd07b84d23c7999fb6cec486a889a5 | |
parent | dc5a746e1db21247c1ac2d2381d887a11e877aea (diff) |
focus
-rw-r--r-- | js/build/app.js | 14 | ||||
-rw-r--r-- | js/directive/NewsFocus.js | 22 | ||||
-rw-r--r-- | templates/part.addnew.php | 4 |
3 files changed, 39 insertions, 1 deletions
diff --git a/js/build/app.js b/js/build/app.js index 85ecaf878..81b92d4d0 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -1606,6 +1606,20 @@ var $__build_47_app__ = function () { }; } ]); + app.directive('newsFocus', [ + '$timeout', + function ($timeout) { + 'use strict'; + return function (scope, elem, attrs) { + elem.click(function () { + var toReadd = $(attrs.newsFocus); + $timeout(function () { + toReadd.focus(); + }, 500); + }); + }; + } + ]); app.directive('newsReadFile', function () { 'use strict'; return function (scope, elem, attr) { 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 diff --git a/templates/part.addnew.php b/templates/part.addnew.php index bf986e5c0..cefc76aa6 100644 --- a/templates/part.addnew.php +++ b/templates/part.addnew.php @@ -1,6 +1,8 @@ <li class="add-new"> <div class="list-title list-title-with-icon heading"> - <button data-apps-slide-toggle=".add-new-popup">+ <?php p($l->t('Add Website'))?></button> + <button + data-apps-slide-toggle=".add-new-popup" + news-focus="[ng-model='feedUrl']">+ <?php p($l->t('Add Website'))?></button> </div> <div class="add-new-popup"> |