Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 (function(){ | 1 (function(){ |
2 document.addEventListener("DOMContentLoaded", function() | 2 document.addEventListener("DOMContentLoaded", function() |
3 { | 3 { |
4 | 4 |
5 /************************************************************************** | 5 /************************************************************************** |
6 * General | 6 * General |
7 **************************************************************************/ | 7 **************************************************************************/ |
8 | 8 |
9 // Change html class name from "no-js" to "js" | 9 // Change html class name from "no-js" to "js" |
10 document.documentElement.className = "js"; | 10 document.documentElement.className = "js"; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 Accordion.prototype._onClick = function(event) | 189 Accordion.prototype._onClick = function(event) |
190 { | 190 { |
191 if (!event.target.classList.contains("accordion-toggle-button")) return; | 191 if (!event.target.classList.contains("accordion-toggle-button")) return; |
192 | 192 |
193 this.toggleSection(event.target); | 193 this.toggleSection(event.target); |
194 } | 194 } |
195 | 195 |
196 if (document.getElementById('product-topics-accordion')) | 196 var productTopicsAccordion = document.getElementById('product-topics-accordi on'); |
juliandoucette
2017/10/11 15:09:48
NIT: I would query once and [check, use] the resul
ire
2017/10/11 17:01:41
I prefer your suggestion. Done.
| |
197 { | 197 if (productTopicsAccordion) |
198 new Accordion(document.getElementById('product-topics-accordion')); | 198 { |
199 new Accordion(productTopicsAccordion); | |
199 } | 200 } |
200 | 201 |
201 }, false); | 202 }, false); |
202 }()); | 203 }()); |
LEFT | RIGHT |