-
Notifications
You must be signed in to change notification settings - Fork 103
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
Frontend component's initialisation not clean for ajax website #31
Comments
Fair point. SPA/AJAX sites weren't the focus during development, but there's no reason not to support them. Were you anticipating a separate function for each element type? What is the best practice when it comes to functions of this type? Presumably they shouldn't be global scope, but accessible through the Tailor object.. |
No. I took all functions for reload all elements. Maybe it will be accessible through something like |
Fixed: User permission check being called too early, resulting in a warning message [GitHub #30](https://github.com/andrew-worsfold/tailor/issues/30), fuzzy spinner image [GitHub #34](https://github.com/andrew-worsfold/tailor/issues/34). Developer: Consolidated frontend element initialization into a single function [GitHub #31](https://github.com/andrew-worsfold/tailor/issues/31), added filter for empty content placeholder text [GitHub #33](https://github.com/andrew-worsfold/tailor/issues/33).
I've updated the frontend scripts so that there is now a Tailor object. You can use the initElements function to initialize all default elements. Check out the latest commit for Tailor 1.5.5. Does that work for you? |
Perfect! That works well. |
No, sorry, I made a mistake. |
You're right. A fix for this will be added in the next release of Tailor. |
Added: Added support for input HTML tags in content. Fixed: Template custom post type is public [GitHub #37](https://github.com/andrew-worsfold/tailor/issues/37), frontend element initialization function is not globally accessible [GitHub #31](https://github.com/andrew-worsfold/tailor/issues/31), custom style formats defined by themes and plugins not being displayed in the editor, excerpts are displayed for password protected posts. Developer: Added filter for control arguments by control type (e.g., colorpicker).
It's work well this time. I got it with |
With a single page application, a full ajax website or just new content added by ajax, all component's initialisation need to be reloaded for this new content. I did this by copy-paste in my theme the lines 21-81 of this file.
But this isn't DRY and not safe for future update. It will be better to wrap this component's initialisation in a function which could be call anywhere in our themes.
The text was updated successfully, but these errors were encountered: