-
Notifications
You must be signed in to change notification settings - Fork 38
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
More clean up in how we load js and css files #4287
base: main
Are you sure you want to change the base?
Conversation
hypha/templates/base.html
Outdated
<!-- Please do not add new features that require jQuery! --> | ||
<script src="{% static 'js/vendor/jquery.min.js' %}"></script> | ||
|
||
{{ form.media.js }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theskumar Is this ok, any drawbacks?
Seems to have no ill effect. On many pages there are no "form.media*" but then it just outputs nothing silently.
This is needed on many htmx loaded dialogs etc. Loading it here we make sure it is loaded after jQuery and available when needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see much of an issue. I would suggest wrapping it in a if
condition. I probably won't happen, but do check for duplicate rendering, one via the {{ form }}
itself or in the inline template and one in the base template.
For the dialog/htmx, the file upload widget and select2 might break, they don't reinitialize if new element is added dynamically.
b24d254
to
8863a2e
Compare
I didn't see any issues in my testing, seems pretty good! |
As @theskumar predicted this PR breaks file uploads in htmx dialogs. |
…n base.html. Move jQuery back to the bottom of tha page.
…k extra js in templates.
8863a2e
to
7c64842
Compare
Test Steps