bump 1.1.2

This commit is contained in:
qingwei.li 2016-12-17 15:17:20 +08:00
parent 6463dd3bae
commit fe33e2d506
2 changed files with 17 additions and 8 deletions

View File

@ -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

File diff suppressed because one or more lines are too long