diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-02-12 03:12:29 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-02-12 03:12:29 +0100 |
commit | a1e85b1e4cc145e65575c08702f2e72f5ced1235 (patch) | |
tree | 402929441bb6113340e503c4010abd765ba432f2 /coffee/lib | |
parent | 17902de40c7db3228219e673e7c05419bb12d4a4 (diff) |
stored copy in oc lib folder for further usage
Diffstat (limited to 'coffee/lib')
-rw-r--r-- | coffee/lib/directives/forwardclick.coffee | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/coffee/lib/directives/forwardclick.coffee b/coffee/lib/directives/forwardclick.coffee new file mode 100644 index 000000000..b887a1de4 --- /dev/null +++ b/coffee/lib/directives/forwardclick.coffee @@ -0,0 +1,27 @@ +### +# ownCloud +# +# @author Bernhard Posselt +# 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('OC').directive 'forwardClick', -> + + return (scope, elm, attr) -> + options = scope.$eval(attr.forwardClick) + + if angular.isDefined(options.selector) + elm.click -> + $(options.selector).trigger('click') |