Fix auto2top in mobile

This commit is contained in:
qingwei.li 2016-12-17 15:08:44 +08:00
commit 299c31dff9
4 changed files with 21 additions and 6 deletions

View file

@ -70,7 +70,7 @@ export function renderArticle (content) {
renderSidebar.rendered = false
renderNavbar.rendered = false
if (OPTIONS.auto2top) scroll2Top('section.content')
if (OPTIONS.auto2top) scroll2Top()
}
/**
@ -123,14 +123,15 @@ export function renderLoading ({ loaded, total }) {
CACHE['loading'] = div
}
CACHE['loading'].style.opacity = 1
CACHE['loading'].style.width = num + '%'
if (num >= 95) {
clearTimeout(renderLoading.cacheTImeout)
renderLoading.cacheTImeout = setTimeout(_ => {
CACHE['loading'].style.opacity = 0
CACHE['loading'].style.width = '0%'
}, 200)
} else {
CACHE['loading'].style.opacity = 1
CACHE['loading'].style.width = num + '%'
}
}