diff --git a/common/header.html b/common/header.html index abefb4e..b712089 100644 --- a/common/header.html +++ b/common/header.html @@ -41,7 +41,7 @@ return link; }; - const setUpTocItem = function(item) { + const setUpTocItem = function (item) { const unique = item.attr("id"); const text = item.text(); @@ -59,15 +59,15 @@ return tocItem; }; - (function(dToc) { + (function (dToc) { dToc($, window); $.widget("discourse.dToc", { - _create: function() { + _create: function () { this.generateDtoc(); this.setEventHandlers(); }, - generateDtoc: function() { + generateDtoc: function () { const self = this; const primaryHeadings = $(this.options.cooked).find( @@ -76,7 +76,7 @@ self.element.addClass("d-toc"); - primaryHeadings.each(function(index) { + primaryHeadings.each(function (index) { const selectors = self.options.selectors, ul = $("` + ) + .parents(".topic-post") + .addClass("d-toc-post") + .parents("body") + .addClass("d-toc-timeline"); - $("#d-toc").dToc({ - cooked: body, - selectors: dTocHeadingSelectors + $("#d-toc").dToc({ + cooked: body, + selectors: dTocHeadingSelectors + }); }); - }); - }, {id: "disco-toc"}); + }, + { id: "disco-toc" } + ); api.cleanupStream(() => { $(window).off("scroll.d-toc"); @@ -362,7 +363,6 @@ } I18n.translations[I18n.currentLocale()].js.composer.contains_dtoc = " "; - api.addToolbarPopupMenuOptionsCallback(() => { const composerController = api.container.lookup("controller:composer"); return {