aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.accordion.js
diff options
context:
space:
mode:
authorEduardo Lundgren <eduardolundgren@gmail.com>2008-09-30 02:50:23 +0000
committerEduardo Lundgren <eduardolundgren@gmail.com>2008-09-30 02:50:23 +0000
commit5b6323d0a3f2f49243e6c345c5f309df19b9e30e (patch)
treeff9feb68b33d56759fa726ad7f0c3e03e4ff83bd /ui/ui.accordion.js
parent0f58c499bef475e10f2340d22d7b3aec92d2e8e6 (diff)
downloadjquery-ui-5b6323d0a3f2f49243e6c345c5f309df19b9e30e.tar.gz
jquery-ui-5b6323d0a3f2f49243e6c345c5f309df19b9e30e.zip
Accordion: added support for effects.core ease equations
Diffstat (limited to 'ui/ui.accordion.js')
-rw-r--r--ui/ui.accordion.js42
1 files changed, 37 insertions, 5 deletions
diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js
index 9f01e9c12..7b47ee3de 100644
--- a/ui/ui.accordion.js
+++ b/ui/ui.accordion.js
@@ -127,23 +127,55 @@ function toggle(toShow, toHide, data, clickedActive, down) {
options.running = toHide.size() === 0 ? toShow.size() : toHide.size();
if ( options.animated ) {
+ var animOptions = {};
+
if ( !options.alwaysOpen && clickedActive ) {
- $.ui.accordion.animations[options.animated]({
+ animOptions = {
toShow: jQuery([]),
toHide: toHide,
complete: complete,
down: down,
autoHeight: options.autoHeight
- });
+ };
} else {
- $.ui.accordion.animations[options.animated]({
+ animOptions = {
toShow: toShow,
toHide: toHide,
complete: complete,
down: down,
autoHeight: options.autoHeight
- });
+ };
+ }
+
+ if (!options.proxied) {
+ options.proxied = options.animated;
+ }
+
+ if (!options.proxiedDuration) {
+ options.proxiedDuration = options.duration;
}
+
+ options.animated = $.isFunction(options.proxied) ?
+ options.proxied(animOptions) : options.proxied;
+
+ options.duration = $.isFunction(options.proxiedDuration) ?
+ options.proxiedDuration(animOptions) : options.proxiedDuration;
+
+ var animations = $.ui.accordion.animations,
+ duration = options.duration,
+ easing = options.animated;
+
+ if (!animations[easing]) {
+ animations[easing] = function(options) {
+ this.slide(options, {
+ easing: easing,
+ duration: duration || 700
+ });
+ };
+ }
+
+ animations[easing](animOptions);
+
} else {
if ( !options.alwaysOpen && clickedActive ) {
toShow.toggle();
@@ -279,7 +311,7 @@ $.extend($.ui.accordion, {
},
bounceslide: function(options) {
this.slide(options, {
- easing: options.down ? "bounceout" : "swing",
+ easing: options.down ? "easeOutBounce" : "swing",
duration: options.down ? 1000 : 200
});
},