修复照片墙尾页加载bug
This commit is contained in:
parent
a0d0f72017
commit
fc9a0d844d
@ -211,10 +211,10 @@ function loadMoreItems(step) {
|
|||||||
}
|
}
|
||||||
if(index >= res.data.files.length) { // 已到达当前分组列表的末尾
|
if(index >= res.data.files.length) { // 已到达当前分组列表的末尾
|
||||||
groupid++
|
groupid++
|
||||||
|
let tempIndex = currentIndex
|
||||||
|
currentIndex = 0
|
||||||
if(index<currentIndex+step) { // 如果加载的数据数量不足步长
|
if(index<currentIndex+step) { // 如果加载的数据数量不足步长
|
||||||
// 则需要再加载下一个分组, 下一个分组需要加载的图片数量是剩余的步长
|
// 则需要再加载下一个分组, 下一个分组需要加载的图片数量是剩余的步长
|
||||||
let tempIndex = currentIndex
|
|
||||||
currentIndex = 0
|
|
||||||
loadMoreItems(tempIndex + step - index)
|
loadMoreItems(tempIndex + step - index)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: 文章分类
|
title: 文章分类
|
||||||
date: 2019-05-13 23:13:59
|
date: 2019-05-13 23:13:59
|
||||||
type: categories
|
|
||||||
layout: categories
|
layout: categories
|
||||||
|
pageid: categories
|
||||||
---
|
---
|
||||||
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: 照片墙
|
title: 照片墙
|
||||||
date: 2019-05-12 15:50:10
|
date: 2019-05-12 15:50:10
|
||||||
|
layout: photo-wall
|
||||||
pageid: PhotoWall
|
pageid: PhotoWall
|
||||||
---
|
---
|
||||||
|
|
||||||
<div id="photo-wall"></div><div id="load-tip">正在加载ԅ( ¯་། ¯ԅ)</div>
|
|
||||||
|
|||||||
1
themes/yilia/layout/photo-wall.ejs
Normal file
1
themes/yilia/layout/photo-wall.ejs
Normal file
@ -0,0 +1 @@
|
|||||||
|
<div id="photo-wall"></div><div id="load-tip">正在加载ԅ( ¯་། ¯ԅ)</div>
|
||||||
@ -11,9 +11,16 @@
|
|||||||
}
|
}
|
||||||
.category-count {
|
.category-count {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
line-height: 3;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
// hexo自带的标签云
|
// hexo自带的标签云
|
||||||
.tag-cloud {
|
.tag-cloud {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
a {
|
||||||
|
margin: 0 20px;
|
||||||
|
word-break: keep-all;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -69,10 +69,10 @@ function loadMoreItems(step) {
|
|||||||
}
|
}
|
||||||
if(index >= res.data.files.length) { // 已到达当前分组列表的末尾
|
if(index >= res.data.files.length) { // 已到达当前分组列表的末尾
|
||||||
groupid++
|
groupid++
|
||||||
|
let tempIndex = currentIndex
|
||||||
|
currentIndex = 0
|
||||||
if(index<currentIndex+step) { // 如果加载的数据数量不足步长
|
if(index<currentIndex+step) { // 如果加载的数据数量不足步长
|
||||||
// 则需要再加载下一个分组, 下一个分组需要加载的图片数量是剩余的步长
|
// 则需要再加载下一个分组, 下一个分组需要加载的图片数量是剩余的步长
|
||||||
let tempIndex = currentIndex
|
|
||||||
currentIndex = 0
|
|
||||||
loadMoreItems(tempIndex + step - index)
|
loadMoreItems(tempIndex + step - index)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user