Repository navigation
Allow theme changes for pl-file-editor - #6476
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have reviewed and hereby sign the CLA |
nwalters512
left a comment
There was a problem hiding this comment.
Glad you got the modal issue figured out! I gave this a spin and functionally it's looking nice.
One thought: it might be nice to update the theme in real-time as the user selects different options in the modal. That way, they can at least get a sense of what the theme they chose looks like, even if it's partly hidden behind the modal.
| <div class="modal-dialog modal-dialog-centered" role="document"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 class="modal-title" id="exampleModalLabel">Editor Settings</h5> |
There was a problem hiding this comment.
This is not an appropriate id for this modal. You should incorporate the uuid in case there are multiple file editors on the page.
There was a problem hiding this comment.
By uuid do you mean the uuid passed in when creating editor instance?
There was a problem hiding this comment.
Actually I was thinking we should add id to line 32 instead. Shouldn't it be on the entire modal itself instead of on modal-title?
There was a problem hiding this comment.
No, the ID should be on the title, and the modal itself should reference that ID via aria-labelledby="...". See https://getbootstrap.com/docs/4.6/components/modal/#accessibility for more details.
|
@nwalters512 I believe I have finished most of the desired features. This code might still need a bit of refactoring but should be functionally good. |
|
@nwalters512 Hi! I have updated the 'sync settings' part, now every time the 'save' button is clicked, a custom event will be fired and can be listened to by other editors on the same page to update their theme. I might change the event name to |
|
@louisunlimited Awesome! I think only changing the current editor as a sort of "preview" is fine. Let me review your latest changes. |
nwalters512
left a comment
There was a problem hiding this comment.
This is looking great! A few more small things and this will be good to go.
|
All done! |
nwalters512
left a comment
There was a problem hiding this comment.
Looks great - thanks for the contribution!
Finally got modal working, now everything should work as desired. The themes are persisted through localStorage and will be loaded once a new FileEditor instance is created. I was wondering if I need to let jquery handle modal dismiss or is the current implementation okay (data-dismiss="modal").