diff --git a/js/modules/Resizer.js b/js/modules/Resizer.js index 01f7570..f597720 100644 --- a/js/modules/Resizer.js +++ b/js/modules/Resizer.js @@ -323,6 +323,8 @@ function _res_applyCss(dimensions){ for(var key in dimensions) styleArray.push( dimensions[key] ); + + // build style string back var styleString = ""; for(var i in styleArray) @@ -342,6 +344,10 @@ var _res_antiCssOverride = function(){ if(GlobalVars.video == undefined || GlobalVars.video == null) return; + // // our current css is fucky? Null, undefined and 0 are invalid values. + // if(! GlobalVars.currentCss.width || ! GlobalVars.currentCss.height ) + // return; + var styleArrayStr = GlobalVars.video.getAttribute('style'); if (styleArrayStr !== null && styleArrayStr !== undefined){ @@ -357,7 +363,7 @@ var _res_antiCssOverride = function(){ if(styleArray[i] != GlobalVars.currentCss.top){ if(Debug.debug){ console.log("[Resizer::_res_antiCssOverride] SOMEBODY TOUCHED MA SPAGHETT (our CSS got overriden, restoring our css)"); - console.log("[Resizer::_res_antiCssOverride] MA SPAGHETT: width:", GlobalVars.currentCss.width, "height:", GlobalVars.currentCss.height, "thing that touched ma spaghett", styleArrayStr); + console.log("[Resizer::_res_antiCssOverride] MA SPAGHETT: top:", GlobalVars.currentCss.top, "left:", GlobalVars.currentCss.left, "thing that touched ma spaghett", styleArrayStr); } _res_restore(); return; diff --git a/js/uw.js b/js/uw.js index db84ec0..e874e79 100644 --- a/js/uw.js +++ b/js/uw.js @@ -24,6 +24,14 @@ async function main(){ var scpromise = SitesConf.init(); var kbpromise = Keybinds.init(); + // reset current css stuff in GlobalVars + GlobalVars.correctedVideoDimensions.top = null; + GlobalVars.correctedVideoDimensions.left = null; + GlobalVars.correctedVideoDimensions.width = null; + GlobalVars.correctedVideoDimensions.height = null; + + GlobalVars.currentCss = {top: null, left: null}; + // počakamo, da so nastavitve naložene // wait for settings to load await scpromise; @@ -103,8 +111,13 @@ function ghettoOnChange(){ video.videoHeight > 0 ){ if(Debug.debug){ console.log("%c[uw::ghettoOnChange] detected video. registering!", "color: #99f, background: #000"); + console.log("[uw::ghettoOnChange] just for shits and giggles, let's see what's happened with GlobalVars.playerDimensions:", GlobalVars.playerDimensions) } + // zaznali smo novo