Skip to content

Commit

Permalink
Merge branch 'reduce_thumbnails' into thumbnail_wrong_filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
glubsy committed Jan 25, 2021
2 parents 40ff56e + a2d21cf commit 8f5410c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/_h5ai/public/js/lib/ext/preview/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 2 additions & 17 deletions src/_h5ai/public/js/lib/ext/thumbnails.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,16 @@ 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,
href: item.absHref,
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);
}
}
});
Expand Down

0 comments on commit 8f5410c

Please sign in to comment.