FIX: Text selection disappearing when lazyYT is applied.

This commit is contained in:
Guo Xiang Tan 2017-01-05 12:06:07 +08:00
parent 107d1bb357
commit a1aeedde53
1 changed files with 8 additions and 8 deletions

View File

@ -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();
}});
}
});