mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 10:31:20 -08:00
fix(thumbnailsMix): streamline loading logic and variable names
- Renamed 'loading' to 'loding' for consistency. - Removed unnecessary 'isLoad' variable. - Simplified loading checks in the showThumbnails function.
This commit is contained in:
1 parent
8cb9cd480c
commit
a93967d518
3 files changed
+13
-17
No files matched your search
@@ -7,16 +7,14 @@ export default function thumbnailsMix(art) {
|
||||
} = art
|
||||
|
||||
let timer = null
|
||||
let loding = false
|
||||
let image = null
|
||||
let loading = false
|
||||
let isLoad = false
|
||||
|
||||
function reset() {
|
||||
clearTimeout(timer)
|
||||
timer = null
|
||||
loding = false
|
||||
image = null
|
||||
loading = false
|
||||
isLoad = false
|
||||
}
|
||||
|
||||
function showThumbnails(posWidth) {
|
||||
@@ -55,13 +53,13 @@ export default function thumbnailsMix(art) {
|
||||
const isMobileDragging = type === 'played' && event && isMobile
|
||||
|
||||
if (type === 'hover' || isMobileDragging) {
|
||||
if (!loading) {
|
||||
loading = true
|
||||
if (!image && !loding) {
|
||||
loding = true
|
||||
image = await loadImg(url, scale)
|
||||
isLoad = true
|
||||
loding = false
|
||||
}
|
||||
|
||||
if (!isLoad)
|
||||
if (!image)
|
||||
return
|
||||
|
||||
const width = $progress.clientWidth * percentage
|
||||
|
||||
Reference in new issue
Block a user