aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2008-11-21 04:58:53 +0000
committerRichard Worth <rdworth@gmail.com>2008-11-21 04:58:53 +0000
commit03d6a64695d86e103eb5c8464aeb231e651c4256 (patch)
treebed14eef80636c1b43eec8760a0a614e46594bfe /ui
parent1c97a20d019946bdb6010ca8dd7ee3e6f14cf1fc (diff)
downloadjquery-ui-03d6a64695d86e103eb5c8464aeb231e651c4256.tar.gz
jquery-ui-03d6a64695d86e103eb5c8464aeb231e651c4256.zip
accordion: formatting changes - moved some things around for consistency.
_init and destroy at the top. Sorted defaults alphabetically.
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.accordion.js36
1 files changed, 19 insertions, 17 deletions
diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js
index 5cc6a5cc7..d30bd9217 100644
--- a/ui/ui.accordion.js
+++ b/ui/ui.accordion.js
@@ -13,6 +13,7 @@
(function($) {
$.widget("ui.accordion", {
+
_init: function() {
var options = this.options;
@@ -96,6 +97,19 @@ $.widget("ui.accordion", {
}
},
+ destroy: function() {
+ this.options.headers.parent().andSelf().removeClass(this.options.selectedClass);
+ this.options.headers.prev(".ui-accordion-left").remove();
+ this.options.headers.children(".ui-accordion-right").remove();
+ this.options.headers.next().css("display", "");
+ if ( this.options.fillSpace || this.options.autoHeight ) {
+ this.options.headers.next().css("height", "");
+ }
+ $.removeData(this.element[0], "accordion");
+
+ this.element.removeClass("ui-accordion").unbind(".accordion");
+ },
+
_keydown: function(event) {
if (this.options.disabled || event.altKey || event.ctrlKey)
return;
@@ -135,20 +149,8 @@ $.widget("ui.accordion", {
clickHandler.call(this.element[0], {
target: findActive( this.options.headers, index )[0]
});
- },
-
- destroy: function() {
- this.options.headers.parent().andSelf().removeClass(this.options.selectedClass);
- this.options.headers.prev(".ui-accordion-left").remove();
- this.options.headers.children(".ui-accordion-right").remove();
- this.options.headers.next().css("display", "");
- if ( this.options.fillSpace || this.options.autoHeight ) {
- this.options.headers.next().css("height", "");
- }
- $.removeData(this.element[0], "accordion");
-
- this.element.removeClass("ui-accordion").unbind(".accordion");
}
+
});
function scopeCallback(callback, scope) {
@@ -329,16 +331,16 @@ function findActive(headers, selector) {
$.extend($.ui.accordion, {
version: "@VERSION",
defaults: {
- selectedClass: "selected",
+ autoHeight: true,
alwaysOpen: true,
animated: 'slide',
event: "click",
header: "a",
- autoHeight: true,
- running: 0,
navigationFilter: function() {
return this.href.toLowerCase() == location.href.toLowerCase();
- }
+ },
+ running: 0,
+ selectedClass: "selected"
},
animations: {
slide: function(options, additions) {