1
0
Fork 0
mirror of https://github.com/lrsjng/h5ai synced 2026-01-03 22:52:24 +01:00

Merge branch 'reduce_thumbnails' into thumbnail_wrong_filetype

This commit is contained in:
glubsy 2021-01-25 02:10:51 +00:00
commit 8f5410c865
2 changed files with 3 additions and 18 deletions

View file

@ -213,7 +213,7 @@ Session.prototype = {
}
});
dom('#pv-container').hide().clr();
showSpinner(true, item.thumbSquare || item.icon, 200);
showSpinner(true, item.thumbRational || item.icon, 200);
})
.then(() => this.load(item))
// delay for testing

View file

@ -30,23 +30,8 @@ const queueItem = (queue, item) => {
type = 'file'
}
if (item.thumbSquare) {
item.$view.find('.icon.square img').addCls('thumb').attr('src', item.thumbSquare);
} else {
queue.push({
type,
href: item.absHref,
callback: src => {
if (src && item.$view) {
item.thumbSquare = src;
item.$view.find('.icon.square img').addCls('thumb').attr('src', src);
}
}
});
}
if (item.thumbRational) {
item.$view.find('.icon.landscape img').addCls('thumb').attr('src', item.thumbRational);
item.$view.find('.icon img').addCls('thumb').attr('src', item.thumbRational);
} else {
queue.push({
type,
@ -54,7 +39,7 @@ const queueItem = (queue, item) => {
callback: src => {
if (src && item.$view) {
item.thumbRational = src;
item.$view.find('.icon.landscape img').addCls('thumb').attr('src', src);
item.$view.find('.icon img').addCls('thumb').attr('src', src);
}
}
});