Fix 'remove video' option

This commit is contained in:
calzoneman 2015-05-14 13:14:45 -05:00
parent 8b69485448
commit 7bc247ede2
2 changed files with 8 additions and 5 deletions

View file

@ -740,6 +740,11 @@ $("#channeloptions li > a[data-toggle='tab']").on("shown.bs.tab", function () {
applyOpts(); applyOpts();
(function () { (function () {
var embed = document.querySelector("#videowrap .embed-responsive");
if (!embed) {
return;
}
if (typeof window.MutationObserver === "function") { if (typeof window.MutationObserver === "function") {
var mr = new MutationObserver(function (records) { var mr = new MutationObserver(function (records) {
records.forEach(function (record) { records.forEach(function (record) {
@ -751,13 +756,13 @@ applyOpts();
}); });
}); });
mr.observe($("#videowrap").find(".embed-responsive")[0], { childList: true }); mr.observe(embed, { childList: true });
} else { } else {
/* /*
* DOMNodeInserted is deprecated. This code is here only as a fallback * DOMNodeInserted is deprecated. This code is here only as a fallback
* for browsers that do not support MutationObserver * for browsers that do not support MutationObserver
*/ */
$("#videowrap").find(".embed-responsive")[0].addEventListener("DOMNodeInserted", function (ev) { embed.addEventListener("DOMNodeInserted", function (ev) {
if (ev.target.id === "ytapiplayer") handleVideoResize(); if (ev.target.id === "ytapiplayer") handleVideoResize();
}); });
} }

View file

@ -733,9 +733,7 @@ function applyOpts() {
} }
if(USEROPTS.hidevid) { if(USEROPTS.hidevid) {
$("#qualitywrap").html("");
removeVideo(); removeVideo();
$("#chatwrap").removeClass("col-lg-5 col-md-5").addClass("col-lg-12 col-md-12");
} }
$("#chatbtn").remove(); $("#chatbtn").remove();
@ -1718,7 +1716,7 @@ function handleVideoResize() {
var intv, ticks = 0; var intv, ticks = 0;
var resize = function () { var resize = function () {
if (++ticks > 10) clearInterval(intv); if (++ticks > 10) clearInterval(intv);
if ($("#ytapiplayer").parent().height() === 0) return; if ($("#ytapiplayer").parent().outerHeight() <= 0) return;
clearInterval(intv); clearInterval(intv);
var responsiveFrame = $("#ytapiplayer").parent(); var responsiveFrame = $("#ytapiplayer").parent();