mirror of
https://github.com/Hutchy68/pivot.git
synced 2025-12-19 15:27:03 +01:00
Update to Foundation.js
This commit is contained in:
parent
cd535df66e
commit
8ae56081c1
@@ -4,7 +4,7 @@
|
||||
Foundation.libs.accordion = {
|
||||
name : 'accordion',
|
||||
|
||||
version : '5.5.2',
|
||||
version : '5.5.3',
|
||||
|
||||
settings : {
|
||||
content_class : 'content',
|
||||
@@ -74,12 +74,49 @@
|
||||
settings = accordion.data(self.attr_name(true) + '-init') || self.settings;
|
||||
|
||||
aunts.children('a').attr('aria-expanded','false');
|
||||
aunts.has('.' + settings.content_class + '.' + settings.active_class).children('a').attr('aria-expanded','true');
|
||||
aunts.has('.' + settings.content_class + '.' + settings.active_class).addClass(settings.active_class).children('a').attr('aria-expanded','true');
|
||||
|
||||
if (settings.multi_expand) {
|
||||
$instance.attr('aria-multiselectable','true');
|
||||
}
|
||||
},
|
||||
|
||||
toggle : function(options) {
|
||||
var options = typeof options !== 'undefined' ? options : {};
|
||||
var selector = typeof options.selector !== 'undefined' ? options.selector : '';
|
||||
var toggle_state = typeof options.toggle_state !== 'undefined' ? options.toggle_state : '';
|
||||
var $accordion = typeof options.$accordion !== 'undefined' ? options.$accordion : this.S(this.scope).closest('[' + this.attr_name() + ']');
|
||||
|
||||
var $items = $accordion.find('> dd' + selector + ', > li' + selector);
|
||||
if ( $items.length < 1 ) {
|
||||
if ( window.console ) {
|
||||
console.error('Selection not found.', selector);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var S = this.S;
|
||||
var active_class = this.settings.active_class;
|
||||
$items.each(function() {
|
||||
var $item = S(this);
|
||||
var is_active = $item.hasClass(active_class);
|
||||
if ( ( is_active && toggle_state === 'close' ) || ( !is_active && toggle_state === 'open' ) || toggle_state === '' ) {
|
||||
$item.find('> a').trigger('click.fndtn.accordion');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
open : function(options) {
|
||||
var options = typeof options !== 'undefined' ? options : {};
|
||||
options.toggle_state = 'open';
|
||||
this.toggle(options);
|
||||
},
|
||||
|
||||
close : function(options) {
|
||||
var options = typeof options !== 'undefined' ? options : {};
|
||||
options.toggle_state = 'close';
|
||||
this.toggle(options);
|
||||
},
|
||||
|
||||
off : function () {},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user