From 9dc158f808902c99cb06ef798d377888bf9a5873 Mon Sep 17 00:00:00 2001 From: Aaron Newton Date: Thu, 27 Oct 2011 11:39:48 -0700 Subject: [PATCH] Adding support for multiple targets for FxReveal behaviors. --- Docs/Delegators/Delegator.Fx.Reveal.md | 4 +++- Source/Delegators/Delegator.FxReveal.js | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Docs/Delegators/Delegator.Fx.Reveal.md b/Docs/Delegators/Delegator.Fx.Reveal.md index 8552e84..6b8e0e2 100644 --- a/Docs/Delegators/Delegator.Fx.Reveal.md +++ b/Docs/Delegators/Delegator.Fx.Reveal.md @@ -15,6 +15,7 @@ Provides delegated links to use [Fx.Reveal](http://mootools.net/docs/more/Fx/Fx. Dissolve self nix parent Nix self + Nix all the links

@@ -22,5 +23,6 @@ The above examples use `Fx.Reveal` to show, hide, and destroy their respective t ### Options -* target - (*string*; required) - a selector which will return the DOM element to show/hide. Use selectors provided by [Slick](https://github.com/mootools/slick) to select parents and sibling trees. +* target - (*string*) - a selector which will return the DOM element to show/hide. Use selectors provided by [Slick](https://github.com/mootools/slick) to select parents and sibling trees. +* targets - (*string*) - same as `target` except this will apply the effect to multiple targets (all the ones that match the selector). * fxOptions - (*object*; optional) - a set of options to be passed to `Fx.Reveal`. \ No newline at end of file diff --git a/Source/Delegators/Delegator.FxReveal.js b/Source/Delegators/Delegator.FxReveal.js index 9bbffad..9d984e1 100644 --- a/Source/Delegators/Delegator.FxReveal.js +++ b/Source/Delegators/Delegator.FxReveal.js @@ -17,10 +17,14 @@ name: Delegator.FxReveal triggers[action] = { handler: function(event, link, api){ var target = link; - if (api.get('target')) { + if (api.get('target')){ target = link.getElement(api.get('target')); if (!target) api.fail('could not locate target element to ' + action, link); } + if (api.get('targets')){ + target = link.getElements(api.get('targets')); + if (!target.length) api.fail('could not locate target elements to ' + action, link); + } var fxOptions = api.get('fxOptions'); if (fxOptions) target.set('reveal', fxOptions);