1/** 2 * @file 3 */ 4 5(function ($, Drupal, drupalSettings) { 6 'use strict'; 7 Drupal.behaviors.views_accordion = { 8 attach: function (context) { 9 if (drupalSettings.views_accordion) { 10 $.each(drupalSettings.views_accordion, function (id) { 11 12 var $display = $(this.display + ':not(.ui-accordion)'); 13 14 /* The row count to be used if Row to display opened on start is set to random */ 15 var row_count = 0; 16 17 /* Prepare our markup for jquery ui accordion */ 18 $(this.header, $display).each(function (i) { 19 // Wrap the accordion content within a div if necessary. 20 if (!this.usegroupheader) { 21 $(this).siblings().wrapAll('<div></div>'); 22 row_count++; 23 } 24 }); 25 26 if (this.rowstartopen == 'random') { 27 this.rowstartopen = Math.floor(Math.random() * row_count); 28 } 29 30 // The settings for the accordion. 31 var accordionSettings = { 32 header: this.header, 33 animate: { 34 'easing': this.animated, 35 'duration': parseInt(this.duration), 36 }, 37 active: this.rowstartopen, 38 collapsible: this.collapsible, 39 heightStyle: this.heightStyle, 40 event: this.event, 41 icons: false 42 }; 43 if (this.useHeaderIcons) { 44 accordionSettings.icons = { 45 'header': this.iconHeader, 46 'activeHeader': this.iconActiveHeader 47 }; 48 } 49 50 /* jQuery UI accordion call */ 51 $display.accordion(accordionSettings); 52 }); 53 } 54 } 55 }; 56})(jQuery, Drupal, drupalSettings);
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.