From 64d1d2c04b4d3a43d17d193819eef83b3b4641a5 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 26 Nov 2016 19:46:20 +0800 Subject: [PATCH] Fix published note won't scroll to hash on load --- public/js/pretty.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/js/pretty.js b/public/js/pretty.js index b5c5ba8ab..f43df90ce 100644 --- a/public/js/pretty.js +++ b/public/js/pretty.js @@ -18,6 +18,7 @@ var smoothHashScroll = extra.smoothHashScroll; var postProcess = extra.postProcess; var updateLastChange = extra.updateLastChange; var parseMeta = extra.parseMeta; +var scrollToHash = extra.scrollToHash; var preventXSS = require('./render').preventXSS; var markdown = $("#doc.markdown-body"); @@ -117,6 +118,7 @@ $(window).resize(function () { $(document).ready(function () { windowResize(); generateScrollspy(); + setTimeout(scrollToHash, 0); //tooltip $('[data-toggle="tooltip"]').tooltip(); });