REFACTOR: Remove `Discourse.SiteSettings` from lightbox.js
This commit is contained in:
parent
94419d0176
commit
4ecb4439b9
|
@ -86,7 +86,7 @@ export default Component.extend(UploadMixin, {
|
|||
},
|
||||
|
||||
_applyLightbox() {
|
||||
if (this.imageUrl) next(() => lightbox(this.element));
|
||||
if (this.imageUrl) next(() => lightbox(this.element, this.siteSettings));
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
|
|
@ -12,6 +12,13 @@ export default {
|
|||
api.decorateCooked(highlightSyntax, {
|
||||
id: "discourse-syntax-highlighting"
|
||||
});
|
||||
|
||||
api.decorateCookedElement(
|
||||
elem => {
|
||||
return lightbox(elem, siteSettings);
|
||||
},
|
||||
{ id: "discourse-lightbox" }
|
||||
);
|
||||
api.decorateCookedElement(lightbox, { id: "discourse-lightbox" });
|
||||
if (siteSettings.support_mixed_text_direction) {
|
||||
api.decorateCooked(setTextDirections, {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { isAppWebview, postRNWebviewMessage } from "discourse/lib/utilities";
|
|||
import { spinnerHTML } from "discourse/helpers/loading-spinner";
|
||||
import User from "discourse/models/user";
|
||||
|
||||
export default function(elem) {
|
||||
export default function(elem, siteSettings) {
|
||||
if (!elem) {
|
||||
return;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ export default function(elem) {
|
|||
$("span.informations", item.el).text()
|
||||
];
|
||||
if (
|
||||
!Discourse.SiteSettings.prevent_anons_from_downloading_files ||
|
||||
!siteSettings.prevent_anons_from_downloading_files ||
|
||||
User.current()
|
||||
) {
|
||||
src.push(
|
||||
|
|
Loading…
Reference in New Issue