mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
fix: closes #13036, if image isn't loaded yet width is 0
This commit is contained in:
@@ -122,8 +122,6 @@ get:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
resizeImageWidth:
|
|
||||||
type: number
|
|
||||||
cookies:
|
cookies:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ define('forum/topic/images', [], function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!imageEl.parent().is('a')) {
|
if (!imageEl.parent().is('a')) {
|
||||||
if (utils.isRelativeUrl(src) && suffixRegex.test(src) && imageEl.get(0).naturalWidth >= config.resizeImageWidth) {
|
if (utils.isRelativeUrl(src) && suffixRegex.test(src)) {
|
||||||
src = src.replace(suffixRegex, '$1');
|
src = src.replace(suffixRegex, '$1');
|
||||||
}
|
}
|
||||||
const alt = imageEl.attr('alt') || '';
|
const alt = imageEl.attr('alt') || '';
|
||||||
|
|||||||
Reference in New Issue
Block a user