FIX: If an audio file is playing, don't cloak it
This commit is contained in:
parent
732d0ad030
commit
98eac4924c
|
@ -8,6 +8,18 @@ export default {
|
|||
withPluginApi('0.1', api => {
|
||||
api.decorateCooked(highlightSyntax);
|
||||
api.decorateCooked(lightbox);
|
||||
|
||||
api.decorateCooked($elem => {
|
||||
const players = $('audio', $elem);
|
||||
if (players.length) {
|
||||
players.on('play', () => {
|
||||
const postId = parseInt($elem.closest('article').data('post-id'));
|
||||
if (postId) {
|
||||
api.preventCloak(postId);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue