mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-30 11:08:58 +08:00
bump 1.1.2
This commit is contained in:
parent
6463dd3bae
commit
fe33e2d506
@ -105,12 +105,16 @@ function getRoute () {
|
||||
return route
|
||||
}
|
||||
|
||||
function isMobile () {
|
||||
return /mobile/i.test(navigator.userAgent)
|
||||
}
|
||||
|
||||
/**
|
||||
* Active sidebar when scroll
|
||||
* @link https://buble.surge.sh/
|
||||
*/
|
||||
function scrollActiveSidebar () {
|
||||
if (/mobile/i.test(navigator.userAgent)) { return }
|
||||
if (isMobile()) { return }
|
||||
|
||||
var anchors = document.querySelectorAll('.anchor');
|
||||
var nav = {};
|
||||
@ -198,8 +202,11 @@ function bindToggle (dom) {
|
||||
}
|
||||
|
||||
var cacheContentDOM;
|
||||
function scroll2Top (dom) {
|
||||
cacheContentDOM = cacheContentDOM || document.querySelector(dom);
|
||||
function scroll2Top () {
|
||||
if (!cacheContentDOM) {
|
||||
var dom = isMobile() ? 'body' : 'section.content';
|
||||
cacheContentDOM = document.querySelector(dom);
|
||||
}
|
||||
cacheContentDOM.scrollTop = 0;
|
||||
}
|
||||
|
||||
@ -2412,7 +2419,7 @@ function renderArticle (content) {
|
||||
renderSidebar.rendered = false;
|
||||
renderNavbar.rendered = false;
|
||||
|
||||
if (OPTIONS$1.auto2top) { scroll2Top('section.content'); }
|
||||
if (OPTIONS$1.auto2top) { scroll2Top(); }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2468,14 +2475,16 @@ function renderLoading (ref) {
|
||||
CACHE['loading'] = div;
|
||||
}
|
||||
|
||||
CACHE['loading'].style.opacity = 1;
|
||||
CACHE['loading'].style.width = num + '%';
|
||||
if (num >= 95) {
|
||||
clearTimeout(renderLoading.cacheTImeout);
|
||||
CACHE['loading'].style.width = '100%';
|
||||
renderLoading.cacheTImeout = setTimeout(function (_) {
|
||||
CACHE['loading'].style.opacity = 0;
|
||||
CACHE['loading'].style.width = '0%';
|
||||
}, 200);
|
||||
} else {
|
||||
CACHE['loading'].style.opacity = 1;
|
||||
CACHE['loading'].style.width = num + '%';
|
||||
}
|
||||
}
|
||||
|
||||
|
4
lib/docsify.min.js
vendored
4
lib/docsify.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user