Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: static/js/main.js

Issue 29572657: Issue 5787 - Add Topics Accordion to Article Template on help.eyeo.com (Closed) Base URL: https://hg.adblockplus.org/help.eyeo.com
Patch Set: Created Oct. 10, 2017, 12:27 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: static/js/main.js
===================================================================
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -188,16 +188,15 @@
Accordion.prototype._onClick = function(event)
{
if (!event.target.classList.contains("accordion-toggle-button")) return;
this.toggleSection(event.target);
}
- var accordions = document.getElementsByClassName('accordion');
- for (var i = 0; i < accordions.length; i++)
+ if (document.getElementById('product-topics-accordion'))
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.
{
- new Accordion(accordions[i]);
+ new Accordion(document.getElementById('product-topics-accordion'));
}
}, false);
}());

Powered by Google App Engine
This is Rietveld