ソースを参照

Remove some code, rename buildToc

- contextSelector was not really useful
- renamed function buildToc to ahTocBuildToc to avoid name conflicts
FGM 15 年 前
コミット
d82055933e
1 ファイル変更4 行追加5 行削除
  1. 4 5
      ah_toc.js

+ 4 - 5
ah_toc.js

@@ -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);