Closed (fixed)
Project:
Lazy-load
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2020 at 00:21 UTC
Updated:
27 Nov 2020 at 21:24 UTC
Jump to comment: Most recent
Calling Drupal.attachBehaviors(); causes duplicate script lazysizes library tag includes.
Every time it is called, I end up with duplicated script tags for the main library and any plugins. In my case:
<script src="/libraries/lazysizes/lazysizes.min.js" async=""></script>
<script src="/libraries/lazysizes/plugins/unveilhooks/ls.unveilhooks.min.js" async=""></script>
<script src="/libraries/lazysizes/plugins/parent-fit/ls.parent-fit.min.js" async=""></script>
<script src="/libraries/lazysizes/plugins/object-fit/ls.object-fit.min.js" async=""></script>
<script src="/libraries/lazysizes/plugins/aspectratio/ls.aspectratio.min.js" async="">
Call Drupal.attachBehaviors(); from any script within your theme
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
lindsay.wils commentedComment #5
osmanComment #6
lindsay.wils commentedThanks for looking into this. I have tested and confirm the changes have fixed the issue and can be merged.
Comment #7
osmanMerged the solution to dev branch.