Function getRelativeRetinaSize now decides which size to show on retina display.
This commit is contained in:
parent
1b2b79ec23
commit
08f1d7361c
File diff suppressed because it is too large
Load Diff
|
@ -12,7 +12,7 @@ export const ThumbnailHelperFunctions = () => {
|
|||
},
|
||||
getSrcSet(thumbnail, tainacanSize, documentType) {
|
||||
const defaultSrc = this.getSrc(thumbnail, tainacanSize, documentType);
|
||||
const retinaSrc = (thumbnail && thumbnail['full']) ? thumbnail['full'][0] : this.getEmptyThumbnailPlaceholder(documentType, 'full');
|
||||
const retinaSrc = this.getSrc(thumbnail, this.getRelativeRetinaSize(tainacanSize), documentType);
|
||||
return defaultSrc + ' 1x, ' + retinaSrc + ' 2x';
|
||||
},
|
||||
getWidth(thumbnail, tainacanSize, fallbackSizeValue) {
|
||||
|
@ -92,7 +92,7 @@ export const ThumbnailHelperFunctions = () => {
|
|||
getWordpressFallbackSize(tainacanSize) {
|
||||
switch(tainacanSize) {
|
||||
case 'tainacan-medium-full':
|
||||
return 'medium_large';
|
||||
return 'medium_large';
|
||||
case 'tainacan-medium':
|
||||
return 'medium';
|
||||
case 'tainacan-small':
|
||||
|
@ -100,6 +100,17 @@ export const ThumbnailHelperFunctions = () => {
|
|||
default:
|
||||
return 'thumbnail';
|
||||
}
|
||||
},
|
||||
getRelativeRetinaSize(tainacanSize) {
|
||||
switch(tainacanSize) {
|
||||
case 'tainacan-medium-full':
|
||||
case 'tainacan-medium':
|
||||
return 'large';
|
||||
case 'tainacan-small':
|
||||
return 'tainacan-medium';
|
||||
default:
|
||||
return 'full';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue