diff options
Diffstat (limited to 'view')
-rw-r--r-- | view/css/conversation.css | 13 | ||||
-rw-r--r-- | view/js/main.js | 1 | ||||
-rw-r--r-- | view/tpl/wiki.tpl | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/view/css/conversation.css b/view/css/conversation.css index 0b6674b15..aec457302 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -336,6 +336,19 @@ a.wall-item-name-link { /* bb-code */ +/* prevent [toc] bbcode links to scroll the titles behind the navbar */ +.section-content-wrapper h1, +.section-content-wrapper h2, +.section-content-wrapper h3, +.section-content-wrapper h4 { + padding-top: 60px; + margin-top: -40px; +} + +.toc { + margin-top: 1em; +} + code { font-family: Courier, monospace; font-size: 1em; diff --git a/view/js/main.js b/view/js/main.js index e78725931..3981d4266 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1315,7 +1315,6 @@ $(document).ready(function() { numbers : aStr['t17'], }; - $("#toc").toc(); }); function zFormError(elm,x) { diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index cf4144357..7d698b493 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -184,7 +184,9 @@ function (data) { if (data.success) { $('#wiki-preview').html(data.html); + {{if !$mimeType || $mimeType == 'text/markdown'}} $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); + {{/if}} $('#page-tools').hide(); } else { window.console.log('Error previewing page.'); @@ -418,13 +420,12 @@ $(document).ready(function () { wiki_refresh_page_list(); - $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); - // This seems obsolete // Show Edit tab first. Otherwise the Ace editor does not load. //$("#wiki-nav-tabs li:eq(1) a").tab('show'); {{if !$mimeType || $mimeType == 'text/markdown'}} + $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); window.editor.on("input", function() { if(window.editor.getSession().getUndoManager().isClean()) { $('#save-page').addClass('disabled'); |