Skip to content

Commit

Permalink
Merge pull request #1358 from GrosPoulet/master
Browse files Browse the repository at this point in the history
Fix for plug-in: Spotify
  • Loading branch information
GrosPoulet authored Jun 7, 2024
2 parents c023a19 + cb6dfa8 commit bfe8587
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugins/spotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ hoverZoomPlugins.push({
// track sample: https://open.spotify.com/intl-fr/track/7fj36UASAJfRL4pdD00OPV?si=077b59604f0c4ec0
// -> track id: 7fj36UASAJfRL4pdD00OPV
// note: podcasts (= episodes) not supported
$('a[href*="/track/"]').on('mouseover', function() {
$('a[href*="/track/"]').one('mouseover', function() {

const link = $(this);
const href = this.href;
Expand Down Expand Up @@ -74,7 +74,7 @@ hoverZoomPlugins.push({
handleAudio(link, audioUrl, caption);
}
);
}).on('mouseleave', function () {
}).one('mouseleave', function () {
const link = $(this);
link.data().hoverZoomMouseOver = false;
});
Expand All @@ -100,7 +100,9 @@ hoverZoomPlugins.push({
link.data().hoverZoomSrc = [blobUrl + '.audio'];
link.data().hoverZoomCaption = caption;
callback(link, pluginName);
hoverZoom.displayPicFromElement(link);
// Track is displayed iff the cursor is still over the track
if (link.data().hoverZoomMouseOver)
hoverZoom.displayPicFromElement(link);
})
}
}
Expand Down Expand Up @@ -314,7 +316,9 @@ hoverZoomPlugins.push({
link.data().hoverZoomSrc = [imgUrl];
link.data().hoverZoomCaption = caption;
callback(link, pluginName);
hoverZoom.displayPicFromElement(link);
// Cover is displayed iff the cursor is still over the image
if (link.data().hoverZoomMouseOver)
hoverZoom.displayPicFromElement(link);
}

// albums images
Expand Down

0 comments on commit bfe8587

Please sign in to comment.