Code Plugin - button onclick code not updating content
See original GitHub issueI have the tinymce editor working on my site, and except for this bug I’ve found, it works perfectly. I’m not sure if it’s a known issue, but I don’t seem to be able to update the source code content of the tinymce dialog. I have the ‘code’ plugin active and my source code is as below:
<button class="btn-xs btn-success">Click me to see a GIF of the process</button><img id="integration_gif" class="hideme" style="width: 100%; height: 100%;" src="../uploads/system/images/integration.gif">
I need to add an onclick functionality here in the button as follows:
<button class="btn-xs btn-success" onclick="toggle('integration_gif');">Click me to see a GIF of the process</button><img id="integration_gif" class="hideme" style="width: 100%; height: 100%;" src="../uploads/system/images/integration.gif">
For whatever reason, when I add the onclick event in the button tag (or anywhere else for that matter), it reverts when I click save. However, if I update the information inside the class of the button, that does work.
Any able to shed any light on this problem for me? Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Fantastic. Well this solved my issue. Thanks so much for your help and a great tool!
The schema is too big to keep a copy of it in the documentation - you’ll have to look at the code: https://github.com/tinymce/tinymce/blob/731754d6019938fd74d4d8c233423d3fcdb1148c/modules/tinymce/src/core/main/ts/api/html/Schema.ts#L263-L264
I don’t think we do any validation on attribute values, only whether attributes are allowed.