/[drupal]/contributions/modules/ui/javascript/ui.accordion.js
ViewVC logotype

Diff of /contributions/modules/ui/javascript/ui.accordion.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Sun Sep 2 20:21:42 2007 UTC revision 1.2, Mon Sep 17 03:42:34 2007 UTC
# Line 23  $.extend($.ui.accordion, { Line 23  $.extend($.ui.accordion, {
23                  selectedClass: "selected",                  selectedClass: "selected",
24                  alwaysOpen: true,                  alwaysOpen: true,
25                  animated: 'slide',                  animated: 'slide',
26                  event: "click"                  event: "click",
27                    header: "a"
28          },          },
29          animations: {          animations: {
30                  slide: function(settings, additions) {                  slide: function(settings, additions) {
# Line 45  $.extend($.ui.accordion, { Line 46  $.extend($.ui.accordion, {
46                          settings.toShow.css({ height: 0, overflow: 'hidden' }).show();                          settings.toShow.css({ height: 0, overflow: 'hidden' }).show();
47                          settings.toHide.filter(":hidden").each(settings.finished).end().filter(":visible").animate({height:"hide"},{                          settings.toHide.filter(":hidden").each(settings.finished).end().filter(":visible").animate({height:"hide"},{
48                                  step: function(n){                                  step: function(n){
49                                          settings.toShow.height(Math.ceil( (hideHeight - ($.fn.stop ? n * hideHeight : n)) * difference ));                                          settings.toShow.height(Math.ceil( (hideHeight - (n)) * difference ));
50                                  },                                  },
51                                  duration: settings.duration,                                  duration: settings.duration,
52                                  easing: settings.easing,                                  easing: settings.easing,
# Line 94  $.fn.extend({ Line 95  $.fn.extend({
95                          return this;                          return this;
96    
97                  // setup configuration                  // setup configuration
98                  settings = $.extend({}, $.ui.accordion.defaults, {                  settings = $.extend({}, $.ui.accordion.defaults, settings);
                         // define context defaults  
                         header: $(':first-child', this)[0].tagName // take first childs tagName as header  
                 }, settings);  
99    
100                  if ( settings.navigation ) {                  if ( settings.navigation ) {
101                          var current = this.find("a").filter(function() { return this.href == location.href; });                          var current = this.find("a").filter(function() { return this.href == location.href; });
# Line 137  $.fn.extend({ Line 135  $.fn.extend({
135                          .not(active || "")                          .not(active || "")
136                          .nextUntil(settings.header)                          .nextUntil(settings.header)
137                          .hide();                          .hide();
138                  active.addClass(settings.selectedClass);                  active.parent().andSelf().addClass(settings.selectedClass);
139    
140    
141                  function findActive(selector) {                  function findActive(selector) {
142                          return selector != undefined                          return selector != undefined
143                                  ? typeof selector == "number"                                  ? typeof selector == "number"
144                                          ? headers.eq(selector)                                          ? headers.filter(":eq(" + selector + ")")
145                                          : headers.not(headers.not(selector))                                          : headers.not(headers.not(selector))
146                                  : selector === false                                  : selector === false
147                                          ? $("<div>")                                          ? $("<div>")
148                                          : headers.eq(0)                                          : headers.filter(":eq(0)");
149                  }                  }
150    
151                  function toggle(toShow, toHide, data, clickedActive, down) {                  function toggle(toShow, toHide, data, clickedActive, down) {
# Line 210  $.fn.extend({ Line 208  $.fn.extend({
208                                  return;                                  return;
209    
210                          // switch classes                          // switch classes
211                          active.toggleClass(settings.selectedClass);                          active.parent().andSelf().toggleClass(settings.selectedClass);
212                          if ( !clickedActive ) {                          if ( !clickedActive ) {
213                                  clicked.addClass(settings.selectedClass);                                  clicked.parent().andSelf().addClass(settings.selectedClass);
214                          }                          }
215    
216                          // find elements to show and hide                          // find elements to show and hide

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2