From: ScottDowne Date: Fri, 24 Jun 2011 14:34:49 +0000 (-0400) Subject: [t611] dynamic change of subtitle accessibility X-Git-Tag: v0.7^2~6^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0a4b5ffd79ac9944134390c49f46535f40fae2d9;p=popcorn-js.git [t611] dynamic change of subtitle accessibility --- diff --git a/plugins/subtitle/popcorn.subtitle.js b/plugins/subtitle/popcorn.subtitle.js index 4ed0f86..db24f5d 100755 --- a/plugins/subtitle/popcorn.subtitle.js +++ b/plugins/subtitle/popcorn.subtitle.js @@ -217,7 +217,18 @@ options.accessibility = accessibility; options.toggleSubtitles = function() { - options.selectedLanguage = options.languageSrc.options[ options.languageSrc.selectedIndex ].value; + + options.selectedLanguage = options.languageSrc.options[ options.languageSrc.selectedIndex ].value; + + if ( options.accessibility.checked || options.selectedLanguage !== ( options.language || "") ) { + + options.display = "inline"; + options.container.style.display = options.display; + } else if ( options.selectedLanguage === ( options.language || "") ) { + + options.display = "none"; + options.container.style.display = options.display; + } }; options.accessibility.addEventListener( "change", options.toggleSubtitles, false );