Skip to content
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

Fix #11714: AJAX update containing resources check for duplicates #11715

Merged
merged 3 commits into from Apr 3, 2024

Conversation

melloware
Copy link
Member

Fix #11714: AJAX update containing resources check for duplicates

@melloware melloware added the ⚡ performance Performance related issue or enhancement label Apr 2, 2024
@melloware
Copy link
Member Author

as a note I have tested this heavily with my client project and verified it will only ever add new resources to the Head.

// Check if script or stylesheet already exists and add it to head if it does not
if ($resources.length === 0) {
PrimeFaces.debug("Appending " + type + " to head: " + src);
$("head").append($resource);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may also store head in a var

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@tandraschko tandraschko merged commit 187da0a into primefaces:master Apr 3, 2024
12 checks passed
@melloware melloware deleted the PF11714 branch April 3, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡ performance Performance related issue or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Core: AJAX update of resource doesn't check for duplicate CSS/JS
2 participants