1
- ! function ( e ) { var n = { } ; function t ( r ) { if ( n [ r ] ) return n [ r ] . exports ; var o = n [ r ] = { i :r , l :! 1 , exports :{ } } ; return e [ r ] . call ( o . exports , o , o . exports , t ) , o . l = ! 0 , o . exports } t . m = e , t . c = n , t . d = function ( e , n , r ) { t . o ( e , n ) || Object . defineProperty ( e , n , { configurable :! 1 , enumerable :! 0 , get :r } ) } , t . n = function ( e ) { var n = e && e . __esModule ?function ( ) { return e . default } :function ( ) { return e } ; return t . d ( n , "a" , n ) , n } , t . o = function ( e , n ) { return Object . prototype . hasOwnProperty . call ( e , n ) } , t . p = "/" , t ( t . s = 0 ) } ( { 0 :function ( e , n , t ) { t ( "hghA" ) , e . exports = t ( "Ql/l" ) } , "Ql/l" :function ( e , n ) { var t ; t = document . querySelectorAll ( ".section--home-faqs h3" ) , Array . prototype . forEach . call ( t , function ( e ) { e . innerHTML = '\n <button aria-expanded="false">\n ' + e . textContent + '\n <svg aria-hidden="true" focusable="false" viewBox="0 0 14 30">\n <path fill="#53C5BD" d="M13.9 14.9c0 .3-.1.7-.3.9l-11 13.5c-.5.6-1.4.7-2.1.2-.6-.5-.7-1.4-.2-2.1l10.2-12.5L.3 2.4C-.2 1.8-.1.9.5.3 1.1-.2 2-.1 2.6.5l11 13.5c.2.3.3.6.3.9z"/>\n </svg>\n </button>\n ' ; var n = function ( e ) { for ( var n = [ ] ; e . nextElementSibling && "H3" !== e . nextElementSibling . tagName ; ) n . push ( e . nextElementSibling ) , e = e . nextElementSibling ; return n . forEach ( function ( e ) { e . parentNode . removeChild ( e ) } ) , n } ( e ) , r = document . createElement ( "div" ) ; r . hidden = ! 0 , n . forEach ( function ( e ) { r . appendChild ( e ) } ) , e . parentNode . insertBefore ( r , e . nextElementSibling ) ; var o = e . querySelector ( "button" ) ; o . onclick = function ( ) { var e = "true" === o . getAttribute ( "aria-expanded" ) || ! 1 ; ! 1 === e && t . forEach ( function ( e ) { e . querySelector ( "button" ) . setAttribute ( "aria-expanded" , ! 1 ) , e . nextElementSibling . hidden = ! 0 } ) , o . setAttribute ( "aria-expanded" , ! e ) , r . hidden = e } } ) } , hghA :function ( e , n ) { } } ) ;
1
+ /******/ ( function ( modules ) { // webpackBootstrap
2
+ /******/ // The module cache
3
+ /******/ var installedModules = { } ;
4
+ /******/
5
+ /******/ // The require function
6
+ /******/ function __webpack_require__ ( moduleId ) {
7
+ /******/
8
+ /******/ // Check if module is in cache
9
+ /******/ if ( installedModules [ moduleId ] ) {
10
+ /******/ return installedModules [ moduleId ] . exports ;
11
+ /******/ }
12
+ /******/ // Create a new module (and put it into the cache)
13
+ /******/ var module = installedModules [ moduleId ] = {
14
+ /******/ i : moduleId ,
15
+ /******/ l : false ,
16
+ /******/ exports : { }
17
+ /******/ } ;
18
+ /******/
19
+ /******/ // Execute the module function
20
+ /******/ modules [ moduleId ] . call ( module . exports , module , module . exports , __webpack_require__ ) ;
21
+ /******/
22
+ /******/ // Flag the module as loaded
23
+ /******/ module . l = true ;
24
+ /******/
25
+ /******/ // Return the exports of the module
26
+ /******/ return module . exports ;
27
+ /******/ }
28
+ /******/
29
+ /******/
30
+ /******/ // expose the modules object (__webpack_modules__)
31
+ /******/ __webpack_require__ . m = modules ;
32
+ /******/
33
+ /******/ // expose the module cache
34
+ /******/ __webpack_require__ . c = installedModules ;
35
+ /******/
36
+ /******/ // define getter function for harmony exports
37
+ /******/ __webpack_require__ . d = function ( exports , name , getter ) {
38
+ /******/ if ( ! __webpack_require__ . o ( exports , name ) ) {
39
+ /******/ Object . defineProperty ( exports , name , {
40
+ /******/ configurable : false ,
41
+ /******/ enumerable : true ,
42
+ /******/ get : getter
43
+ /******/ } ) ;
44
+ /******/ }
45
+ /******/ } ;
46
+ /******/
47
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
48
+ /******/ __webpack_require__ . n = function ( module ) {
49
+ /******/ var getter = module && module . __esModule ?
50
+ /******/ function getDefault ( ) { return module [ 'default' ] ; } :
51
+ /******/ function getModuleExports ( ) { return module ; } ;
52
+ /******/ __webpack_require__ . d ( getter , 'a' , getter ) ;
53
+ /******/ return getter ;
54
+ /******/ } ;
55
+ /******/
56
+ /******/ // Object.prototype.hasOwnProperty.call
57
+ /******/ __webpack_require__ . o = function ( object , property ) { return Object . prototype . hasOwnProperty . call ( object , property ) ; } ;
58
+ /******/
59
+ /******/ // __webpack_public_path__
60
+ /******/ __webpack_require__ . p = "/" ;
61
+ /******/
62
+ /******/ // Load entry module and return exports
63
+ /******/ return __webpack_require__ ( __webpack_require__ . s = 0 ) ;
64
+ /******/ } )
65
+ /************************************************************************/
66
+ /******/ ( [
67
+ /* 0 */
68
+ /***/ ( function ( module , exports , __webpack_require__ ) {
69
+
70
+ __webpack_require__ ( 1 ) ;
71
+ module . exports = __webpack_require__ ( 2 ) ;
72
+
73
+
74
+ /***/ } ) ,
75
+ /* 1 */
76
+ /***/ ( function ( module , exports ) {
77
+
78
+ // removed by extract-text-webpack-plugin
79
+
80
+ /***/ } ) ,
81
+ /* 2 */
82
+ /***/ ( function ( module , exports ) {
83
+
84
+ ( function ( ) {
85
+ // Get all the <h3> headings
86
+ var headings = document . querySelectorAll ( '.section--home-faqs h3' ) ;
87
+
88
+ Array . prototype . forEach . call ( headings , function ( heading ) {
89
+ // Give each <h3> a toggle button child
90
+ // with the SVG plus/minus icon
91
+ heading . innerHTML = '\n <button aria-expanded="false">\n ' + heading . textContent + '\n <svg aria-hidden="true" focusable="false" viewBox="0 0 14 30">\n <path fill="#53C5BD" d="M13.9 14.9c0 .3-.1.7-.3.9l-11 13.5c-.5.6-1.4.7-2.1.2-.6-.5-.7-1.4-.2-2.1l10.2-12.5L.3 2.4C-.2 1.8-.1.9.5.3 1.1-.2 2-.1 2.6.5l11 13.5c.2.3.3.6.3.9z"/>\n </svg>\n </button>\n ' ;
92
+
93
+ // Function to create a node list
94
+ // of the content between this <h3> and the next
95
+ var getContent = function getContent ( elem ) {
96
+ var elems = [ ] ;
97
+ while ( elem . nextElementSibling && elem . nextElementSibling . tagName !== 'H3' ) {
98
+ elems . push ( elem . nextElementSibling ) ;
99
+ elem = elem . nextElementSibling ;
100
+ }
101
+
102
+ // Delete the old versions of the content nodes
103
+ elems . forEach ( function ( node ) {
104
+ node . parentNode . removeChild ( node ) ;
105
+ } ) ;
106
+
107
+ return elems ;
108
+ } ;
109
+
110
+ // Assign the contents to be expanded/collapsed (array)
111
+ var contents = getContent ( heading ) ;
112
+
113
+ // Create a wrapper element for `contents` and hide it
114
+ var wrapper = document . createElement ( 'div' ) ;
115
+ wrapper . hidden = true ;
116
+
117
+ // Add each element of `contents` to `wrapper`
118
+ contents . forEach ( function ( node ) {
119
+ wrapper . appendChild ( node ) ;
120
+ } ) ;
121
+
122
+ // Add the wrapped content back into the DOM
123
+ // after the heading
124
+ heading . parentNode . insertBefore ( wrapper , heading . nextElementSibling ) ;
125
+
126
+ // Assign the button
127
+ var btn = heading . querySelector ( 'button' ) ;
128
+
129
+ btn . onclick = function ( ) {
130
+ // Cast the state as a boolean
131
+ var expanded = btn . getAttribute ( 'aria-expanded' ) === 'true' || false ;
132
+
133
+ // Switch the state
134
+ if ( expanded === false ) {
135
+ headings . forEach ( function ( heading ) {
136
+ heading . querySelector ( 'button' ) . setAttribute ( 'aria-expanded' , false ) ;
137
+ heading . nextElementSibling . hidden = true ;
138
+ } ) ;
139
+ }
140
+
141
+ btn . setAttribute ( 'aria-expanded' , ! expanded ) ;
142
+ wrapper . hidden = expanded ;
143
+
144
+ // Switch the content's visibility
145
+ } ;
146
+ } ) ;
147
+ } ) ( ) ;
148
+
149
+ /***/ } )
150
+ /******/ ] ) ;
0 commit comments