From 596ca021ba79e5c885ef030662a92e4123081a04 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 22 Apr 2018 15:11:48 +0200 Subject: [PATCH] some more testing stuff for testers --- js/modules/Resizer.js | 11 ++++++++++- js/uw.js | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/js/modules/Resizer.js b/js/modules/Resizer.js index 686293d..b792715 100644 --- a/js/modules/Resizer.js +++ b/js/modules/Resizer.js @@ -47,7 +47,10 @@ var _res_char = function(newAr, video, player){ // Skrbi za "stare" možnosti, kot na primer "na širino zaslona", "na višino zaslona" in "ponastavi". // Približevanje opuščeno. // handles "legacy" options, such as 'fit to widht', 'fit to height' and 'reset'. No zoom tho -var _res_legacyAr = function(action){ +var _res_legacyAr = function(action){ + if (!vid) { + return; + } var vid = GlobalVars.video; var ar; @@ -354,6 +357,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:", GlobalVars.currentCss.toString(), "thing that touched ma spaghett", styleArrayStr) } _res_restore(); return; @@ -382,6 +386,9 @@ var _res_antiCssOverride = function(){ } var _res_restore = function(){ + if(! GlobalVars.video) + return false; + if(Debug.debug){ console.log("[Resizer::_res_restore] attempting to restore aspect ratio. this & settings:", {'this': this, "settings": Settings} ); } @@ -406,6 +413,8 @@ var _res_restore = function(){ GlobalVars.lastAr = storeLastAr; // ArDetect.init(); } + + return true; } var _res_reset = function(){ diff --git a/js/uw.js b/js/uw.js index a30d7e8..db84ec0 100644 --- a/js/uw.js +++ b/js/uw.js @@ -111,7 +111,7 @@ function ghettoOnChange(){ } } - if(GlobalVars.video === null) + if(! GlobalVars.video) return; if(GlobalVars.playerDimensions == null){ @@ -138,7 +138,7 @@ function ghettoOnChange(){ return; } - Resizer.restore(); + Resizer.restore(); // note: this returns true if change goes through, false otherwise. } // sometimes, checkPlayerSizeChange might not detect a change to fullscreen. This means we need to @@ -169,7 +169,7 @@ function ghettoUrlWatcher(){ GlobalVars.video = null; GlobalVars.lastUrl = window.location.href; - Resizer.reset(); + // Resizer.reset(); main(); } }