mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 16:24:55 +00:00
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 => {
|
withPluginApi('0.1', api => {
|
||||||
api.decorateCooked(highlightSyntax);
|
api.decorateCooked(highlightSyntax);
|
||||||
api.decorateCooked(lightbox);
|
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…
x
Reference in New Issue
Block a user