Skip to content

Improve JS enablement logic/flow #3614

Open
@Spuds

Description

@Spuds

Random thought:
https://github.com/elkarte/Elkarte/pull/3612/files#diff-aed017bb41b71b3f6cd77616ea41ebfe859afe51a7f1c5e2e6585ddf3a81a550R278
wouldn't make sense to toggle these types of behaviours via a variable?
Something like:

theme()->addJavascriptVar(['enable_video' => !empty($modSettings['enableVideoEmbeding']) ? 'true' : 'false');

that way we don't have to assume much on the "source" side and we can load the videos the way we want on the javascript directly?
I guess there is a possible slightly overhead on the client-side, but....is it worth considering?

Originally posted by @emanuele45 in #3612 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions