mirror of
https://github.com/discourse/discourse.git
synced 2025-01-20 16:59:29 +08:00
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() {
|
_applyLightbox() {
|
||||||
if (this.imageUrl) next(() => lightbox(this.element));
|
if (this.imageUrl) next(() => lightbox(this.element, this.siteSettings));
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -12,6 +12,13 @@ export default {
|
||||||
api.decorateCooked(highlightSyntax, {
|
api.decorateCooked(highlightSyntax, {
|
||||||
id: "discourse-syntax-highlighting"
|
id: "discourse-syntax-highlighting"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
api.decorateCookedElement(
|
||||||
|
elem => {
|
||||||
|
return lightbox(elem, siteSettings);
|
||||||
|
},
|
||||||
|
{ id: "discourse-lightbox" }
|
||||||
|
);
|
||||||
api.decorateCookedElement(lightbox, { id: "discourse-lightbox" });
|
api.decorateCookedElement(lightbox, { id: "discourse-lightbox" });
|
||||||
if (siteSettings.support_mixed_text_direction) {
|
if (siteSettings.support_mixed_text_direction) {
|
||||||
api.decorateCooked(setTextDirections, {
|
api.decorateCooked(setTextDirections, {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { isAppWebview, postRNWebviewMessage } from "discourse/lib/utilities";
|
||||||
import { spinnerHTML } from "discourse/helpers/loading-spinner";
|
import { spinnerHTML } from "discourse/helpers/loading-spinner";
|
||||||
import User from "discourse/models/user";
|
import User from "discourse/models/user";
|
||||||
|
|
||||||
export default function(elem) {
|
export default function(elem, siteSettings) {
|
||||||
if (!elem) {
|
if (!elem) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ export default function(elem) {
|
||||||
$("span.informations", item.el).text()
|
$("span.informations", item.el).text()
|
||||||
];
|
];
|
||||||
if (
|
if (
|
||||||
!Discourse.SiteSettings.prevent_anons_from_downloading_files ||
|
!siteSettings.prevent_anons_from_downloading_files ||
|
||||||
User.current()
|
User.current()
|
||||||
) {
|
) {
|
||||||
src.push(
|
src.push(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user