PageSourceSearch

https://donors.vitalant.org/dwp/common/js/foundation.accordion-ce4af557a17f552a992f3c6c16489426.js

js vitalant.org collected 2026-09-24 09:26:44 UTC 1,820 bytes, 61 lines download raw bytes

1;(function ($, window, document, undefined) {
2  'use strict';
3
4  Foundation.libs.accordion = {
5    name : 'accordion',
6
7    version : '5.2.2',
8
9    settings : {
10      active_class: 'active',
11      multi_expand: false,
12      toggleable: true
13    },
14
15    init : function (scope, method, options) {
16      this.bindings(method, options);
17    },
18
19    events : function () {
20      var self = this;
21      var S = this.S;
22      S(this.scope)
23      .off('.fndtn.accordion')
24      .on('click.fndtn.accordion', '[' + this.attr_name() + '] dd > a', function (e) {
25        var accordion = S(this).closest('[' + self.attr_name() + ']'),
26            target = S('#' + this.href.split('#')[1]),
27            siblings = S('dd > .content', accordion),
28            aunts = $('dd', accordion),
29            settings = accordion.data(self.attr_name(true) + '-init'),
30            active_content = S('dd > .content.' + settings.active_class, accordion),
31            active_parent = S('dd.' + settings.active_class, accordion);
32        e.preventDefault();
33
34        if (! S(this).closest('dl').is(accordion)) { return; }
35
36        if (settings.toggleable && target.is(active_content)) {
37          active_parent.toggleClass(settings.active_class, false);
38          return target.toggleClass(settings.active_class, false);
39        }
40
41        if (!settings.multi_expand) {
42          siblings.removeClass(settings.active_class);
43          aunts.removeClass(settings.active_class);
44        }
45
46        target.addClass(settings.active_class).parent().addClass(settings.active_class);
47       
48        if(settings.scrollable) {
49	        $('html, body').animate({
50	            scrollTop:  S(this).offset().top
51	        }, 1000);
52        }
53        
54      });
55    },
56
57    off : function () {},
58
59    reflow : function () {}
60  };
61}(jQuery, this, this.document));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.