- contextSelector was not really useful - renamed function buildToc to ahTocBuildToc to avoid name conflicts
@@ -18,11 +18,10 @@
* @return jQuery
* A list of the headings in the page
*/
-function buildToc() {
+function ahTocBuildToc() {
- var contextSelector = 'div.advanced-help-topic';
- var context = $(contextSelector);
- var elements = $('*', contextSelector).filter(function (index) {
+ var context = $('div.advanced-help-topic');
+ var elements = $('*', context).filter(function (index) {
return ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'H7'].indexOf(this.nodeName) != -1;
});
@@ -50,4 +49,4 @@ function buildToc() {
return elements;
}
-$(buildToc);
+$(ahTocBuildToc);