REFACTOR: Remove `Discourse.SiteSettings` from `PostCooked` widget
This commit is contained in:
parent
531793e98f
commit
9dd6367d81
|
@ -83,7 +83,7 @@ class DecoratorHelper {
|
||||||
* ```
|
* ```
|
||||||
**/
|
**/
|
||||||
cooked(cooked) {
|
cooked(cooked) {
|
||||||
return new PostCooked({ cooked });
|
return new PostCooked({ cooked }, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -93,8 +93,12 @@ export default class PostCooked {
|
||||||
}
|
}
|
||||||
|
|
||||||
_fixImageSizes($html) {
|
_fixImageSizes($html) {
|
||||||
const maxImageWidth = Discourse.SiteSettings.max_image_width;
|
if (!this.decoratorHelper || !this.decoratorHelper.widget) {
|
||||||
const maxImageHeight = Discourse.SiteSettings.max_image_height;
|
return;
|
||||||
|
}
|
||||||
|
let siteSettings = this.decoratorHelper.widget.siteSettings;
|
||||||
|
const maxImageWidth = siteSettings.max_image_width;
|
||||||
|
const maxImageHeight = siteSettings.max_image_height;
|
||||||
|
|
||||||
let maxWindowWidth;
|
let maxWindowWidth;
|
||||||
$html.find("img:not(.avatar)").each((idx, img) => {
|
$html.find("img:not(.avatar)").each((idx, img) => {
|
||||||
|
|
Loading…
Reference in New Issue