disable other buttons in 'extension settings' tab if extension is disabled

This commit is contained in:
Tamius Han 2018-09-20 22:02:15 +02:00
parent d1d8945aac
commit 51c1255eed
2 changed files with 35 additions and 25 deletions

View File

@ -176,6 +176,11 @@ function configurePopupTabs(site) {
MenuTab.videoSettings.classList.remove('disabled');
}
// we assume that these two can be shown. If extension or site are disabled, we'll
// add 'disabled' class later down the line:
document.getElementById("_site_only_when_site_enabled").classList.remove("disabled");
document.getElementById("_ext_only_when_ext_enabled").classList.remove("disabled");
if (! extensionEnabledForSite) {
MenuTab.videoSettings.classList.add('disabled');
@ -184,6 +189,9 @@ function configurePopupTabs(site) {
if (! extensionEnabled) {
MenuTab.siteSettings.classList.add('disabled');
// also disable extra settings for extension
document.getElementById("_ext_only_when_ext_enabled").classList.add("disabled");
if (!selectedMenu) {
openMenu('extensionSettings');
}
@ -196,7 +204,6 @@ function configurePopupTabs(site) {
} else {
MenuTab.videoSettings.classList.remove('disabled');
MenuTab.siteSettings.classList.remove('disabled');
document.getElementById("_site_only_when_site_enabled").classList.remove("disabled");
// if popup isn't being opened for the first time, there's no reason to switch
// we're already in this tab

View File

@ -52,6 +52,7 @@
<a id="_ext_global_options_disabled" class="button _ext _ext_global_options _disabled" >Never</a>
</div>
<div id="_ext_only_when_ext_enabled">
<div class="row">
<span class="label">Enable autodetection:</span>
<div class="button-row">
@ -63,6 +64,7 @@
<!-- TODO: default aspect ratio settings -->
<div class="row">
<span class="label experimental">Default stretching mode</span>
<div class="button-row">
<a id="_stretch_global_none" class="button _stretch _ar_stretch_global _none w24">Never<br/><span id="_b_stretch_default_none_key" class="smallcaps small darker"></span></a>
@ -82,7 +84,8 @@
</div>
</div>
</div>
</div>
</div>
<!-- SITE SETTINGS -->
<div id="_menu_settings_site" class="suboption hidden">