Skip to content

Commit

Permalink
Merge pull request #5698 from avalonmediasystem/playlist_dropdown_dupe
Browse files Browse the repository at this point in the history
Set event listeners once for playlist modal
  • Loading branch information
masaball authored Feb 26, 2024
2 parents 6db6f55 + 1fefccb commit e4e6cc6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/views/media_objects/_add_to_playlist.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ Unless required by applicable law or agreed to in writing, software distributed
addToPlaylistBtn.disabled = false;
}
if(!listenersAdded) {
// Add 'Add new playlist' option to dropdown
window.add_new_playlist_option();
addListeners();
}
}
Expand All @@ -228,8 +231,6 @@ Unless required by applicable law or agreed to in writing, software distributed
currentTime = currentPlayer.player.currentTime();
duration = currentPlayer.player.duration();
}
// Add 'Add new playlist' option to dropdown
window.add_new_playlist_option();
let canvasIndex = parseInt(currentPlayer.dataset.canvasindex);
mediaObjectTitle = playlistForm.dataset.title;
Expand Down

0 comments on commit e4e6cc6

Please sign in to comment.