REFACTOR: Superfluous arguments passed to function resolveSize (#9678)

resolveSize accepts only one param
This commit is contained in:
Joffrey JAFFEUX 2020-05-07 16:36:15 +02:00 committed by GitHub
parent affc79bb68
commit e74170cd9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ function resolveSize(img) {
}
// Detect square images and apply smaller onebox-avatar class
function applySquareGenericOnebox($elem, normalizedUrl) {
function applySquareGenericOnebox($elem) {
if (!$elem.hasClass("whitelistedgeneric")) {
return;
}
@ -43,10 +43,10 @@ function applySquareGenericOnebox($elem, normalizedUrl) {
}
if (img.complete) {
resolveSize(img, $elem, normalizedUrl);
resolveSize(img);
} else {
$img.on("load.onebox", () => {
resolveSize(img, $elem, normalizedUrl);
resolveSize(img);
$img.off("load.onebox");
});
}