chore(destroy): Review destroy method for JS components - FRONT-3610 #2392
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to review the destroy method for JavaScript components. After testing each component, I fixed the remove of some listeners for the following components:
I also changed the way to re-initialize the components when adding/changing the ecl-rtl CSS resource.
In the current state, it does only work for the first addition of the resource. When you click the checkbox, the CSS
<link>
tag is added in the DOM and the onload function is executed. By clicking again the checkbox, the CSS resource remain (onlymedia="max-width: 1px"
is added to the<link>
tag) and nothing happens.I changed the logic by accessing the checkbox at manager level and resetting the component through the iframe preview.