I changed the template upload-selector.hbs
Before
After
The template works well, but my script refuses to work
I inserted this code in the “Header” tab
Please tell me what could be the problem?
I changed the template upload-selector.hbs
Before
After
You must write this stuff within Ember hooks because eg $document.ready
is meaningless in an Ember app.
You may need to look at modifying the js of the modal’s controller depending on your needs.
Thanks for your reply. Why then in the manual Developer’s guide to Discourse Themes say what can be used?
It still works I guess for some use cases (the event will still fire) but if you want to do something intricate in a specific part of the interface I would not use such an event because it does not guarantee availability of some elements of the dom, unlike the ember hooks for components, for example.
Please tell me, is there any documentation so that I can implement something similar?
Usually with these things you will have to interpret the source code and use the Ember Guides to help you.
Additionally studying prior art in existing plugins or Theme Components can be really helpful.
Thanks. I will try to solve it