Hijacks links with “download” attribute and make them light boxes
-
If you want to add a link to a media file and set it up for automatic download by adding an HTML download attribute, this plugin will hijack it and put a click listener on it, which totally breaks the purpose of the link. I wound up running the code below to fix the issue. It could have probably been done with all jQuery, but I’m not familiar with it. I found the jQuery bit on the internet, then I noticed I needed to remove the data-featherlight attribute to get it to work.
Hope this helps!$("a[download]").unbind('click');
let download_links = document.querySelectorAll("a[download]");
download_links.forEach(link => {
link.removeAttribute('data-featherlight');
});
- You must be logged in to reply to this topic.