Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS template not working for card styles #762

Open
kentnek opened this issue Oct 20, 2024 · 2 comments
Open

JS template not working for card styles #762

kentnek opened this issue Oct 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@kentnek
Copy link

kentnek commented Oct 20, 2024

I noticed that version 3.6.0 introduced template support for style. However this doesn't seem to work:

style: ${ this.streamID === 0 ? '.controls { display: none }' : 'some other style' }

or even this

style: ${ '.controls { display: none }' }

Am I missing something? Thanks for the great work anyway!

@AlexxIT AlexxIT added the bug Something isn't working label Oct 20, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Oct 20, 2024

This is because every JS template parsing as JSON. So style should be JSON string and require additional quotations. This should be fixed... style: "\"${ '.mode {display: none}' }\"".

Also, the style will not update when the stream changes. This only works for PTZ templates.

@kentnek
Copy link
Author

kentnek commented Oct 20, 2024

Oh I see, thanks for the clarification! I was thinking of hiding the controls when the poster is showing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants