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);
|
||||
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({
|
||||
onPlay(e, $el) {
|
||||
// don't cloak posts that have playing videos in them
|
||||
|
@ -26,6 +18,14 @@ export default {
|
|||
if (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…
Reference in New Issue