Skip to content

Commit

Permalink
disabling download enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
SH20RAJ authored Mar 17, 2024
1 parent fe06342 commit 6b9def5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions audiplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,18 @@ const ap_audioElements = document.querySelectorAll('.audiplay');
ap_audioElements.forEach((audioElement, index) => {
audioElement.insertAdjacentHTML('beforebegin', ap_html);
createContainer(audioElement, index);

// Check if 'nodownload' attribute is present
if (audioElement.getAttribute("nodownload") !== null) {
const apContainer = audioElement.previousElementSibling;
const downloadButton = apContainer.querySelector('.ap_download');
if (downloadButton) {
downloadButton.style.display = 'none';
}
}
});


// Function to create container with appropriate class
function createContainer(audioElement, index) {
const apContainer = audioElement.previousElementSibling;
Expand Down

0 comments on commit 6b9def5

Please sign in to comment.