mirror of
https://github.com/discourse/discourse.git
synced 2025-04-03 04:19:32 +08:00
FIX: Text selection disappearing when lazyYT is applied.
This commit is contained in:
parent
107d1bb357
commit
a1aeedde53
@ -11,14 +11,6 @@ export default {
|
|||||||
const iframes = $('.lazyYT', $elem);
|
const iframes = $('.lazyYT', $elem);
|
||||||
if (iframes.length === 0) { return; }
|
if (iframes.length === 0) { return; }
|
||||||
|
|
||||||
// We use this because watching videos fullscreen in Chrome was super buggy
|
|
||||||
// otherwise. Thanks to arrendek from q23 for the technique.
|
|
||||||
$elem.iframeTracker({ blurCallback: () => {
|
|
||||||
$(document).on("scroll.discourse-youtube", returnFalse);
|
|
||||||
window.setTimeout(() => $(document).off('scroll.discourse-youtube', returnFalse), 1500);
|
|
||||||
$(document).scroll();
|
|
||||||
}});
|
|
||||||
|
|
||||||
$('.lazyYT', $elem).lazyYT({
|
$('.lazyYT', $elem).lazyYT({
|
||||||
onPlay(e, $el) {
|
onPlay(e, $el) {
|
||||||
// don't cloak posts that have playing videos in them
|
// don't cloak posts that have playing videos in them
|
||||||
@ -26,6 +18,14 @@ export default {
|
|||||||
if (postId) {
|
if (postId) {
|
||||||
api.preventCloak(postId);
|
api.preventCloak(postId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We use this because watching videos fullscreen in Chrome was super buggy
|
||||||
|
// otherwise. Thanks to arrendek from q23 for the technique.
|
||||||
|
$('iframe', iframes).iframeTracker({ blurCallback: () => {
|
||||||
|
$(document).on("scroll.discourse-youtube", returnFalse);
|
||||||
|
window.setTimeout(() => $(document).off('scroll.discourse-youtube', returnFalse), 1500);
|
||||||
|
$(document).scroll();
|
||||||
|
}});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user