diff options
-rw-r--r-- | coffee/directives/forwardclick.coffee | 29 | ||||
-rw-r--r-- | js/app.js | 35 | ||||
-rw-r--r-- | templates/part.settings.php | 2 |
3 files changed, 65 insertions, 1 deletions
diff --git a/coffee/directives/forwardclick.coffee b/coffee/directives/forwardclick.coffee new file mode 100644 index 000000000..bd4108901 --- /dev/null +++ b/coffee/directives/forwardclick.coffee @@ -0,0 +1,29 @@ +### +# ownCloud news app +# +# @author Alessandro Cosentino +# @author Bernhard Posselt +# Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> +# Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com> +# +# This file is licensed under the Affero General Public License version 3 or +# later. +# +# See the COPYING-README file +# +### + +### +Used to forward clicks to another element via jquery selector + +The expression which can be passed looks like this {selector:'#opml-upload'} +### + +angular.module('News').directive 'forwardClick', -> + + return (scope, elm, attr) -> + options = scope.$eval(attr.forwardClick) + + if angular.isDefined(options.selector) + elm.click -> + $(options.selector).trigger('click') @@ -2391,6 +2391,41 @@ /* + Used to forward clicks to another element via jquery selector + + The expression which can be passed looks like this {selector:'#opml-upload'} + */ + + + angular.module('News').directive('forwardClick', function() { + return function(scope, elm, attr) { + var options; + options = scope.$eval(attr.forwardClick); + if (angular.isDefined(options.selector)) { + return elm.click(function() { + return $(options.selector).trigger('click'); + }); + } + }; + }); + + /* + # ownCloud news app + # + # @author Alessandro Cosentino + # @author Bernhard Posselt + # Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> + # Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com> + # + # This file is licensed under the Affero General Public License version 3 or + # later. + # + # See the COPYING-README file + # + */ + + + /* # This is used to signal the settings bar that the app has been focused and that # it should hide */ diff --git a/templates/part.settings.php b/templates/part.settings.php index 99d870cce..5dac1f05a 100644 --- a/templates/part.settings.php +++ b/templates/part.settings.php @@ -1,7 +1,7 @@ <fieldset class="personalblock"> <legend><strong><?php p($l->t('Import / Export OPML')); ?></strong></legend> <input type="file" id="opml-upload" name="files[]" read-file/> - <button title="<?php p($l->t('Import')); ?>" trigger-click> + <button title="<?php p($l->t('Import')); ?>" forward-click="{selector:'#opml-upload'}"> <?php p($l->t('Import')); ?> </button> <a class="button" |