Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/carsonip/hugo-theme-minos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaushal Modi <kaushal.modi@gmail.com>2017-02-26 23:24:14 +0300
committerKaushal Modi <kaushal.modi@gmail.com>2017-02-26 23:24:14 +0300
commit71c937469cf279bd11c768671def4fc7a3e3e710 (patch)
treef116ce56127e175420ef980e9a24c4160373b05b
parenteadc8b400f3ab77ede06d6b70406188a236d1af1 (diff)
Move the onScroll function definition to above its call
This fix was needed for the smart TOC feature to work on Firefox 45.0.1 https://github.com/carsonip/hugo-theme-minos/issues/1#issuecomment-282579296
-rw-r--r--layouts/partials/article.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/layouts/partials/article.html b/layouts/partials/article.html
index def6103..39674f1 100644
--- a/layouts/partials/article.html
+++ b/layouts/partials/article.html
@@ -49,13 +49,6 @@
if ($toc.length > 0) {
var $window = $(window);
- $window.on('scroll', onScroll);
- $(document).ready(function() {
- $toc.find('a').parent('li').find('ul').hide();
- onScroll();
- document.getElementsByClassName('article-toc')[0].style.display = '';
- });
-
function onScroll(){
var currentScroll = $window.scrollTop();
var h = $('.article-entry h1, .article-entry h2, .article-entry h3, .article-entry h4, .article-entry h5, .article-entry h6');
@@ -76,6 +69,13 @@
$(e).children('a').addClass('active').siblings('ul').show();
});
}
+
+ $window.on('scroll', onScroll);
+ $(document).ready(function() {
+ $toc.find('a').parent('li').find('ul').hide();
+ onScroll();
+ document.getElementsByClassName('article-toc')[0].style.display = '';
+ });
}
})();
</script>