Allow upgrades section to no longer collapse #767
This commit is contained in:
1 parent
091b1f100e
commit
09b0ca83ae
6 files changed
+65
-52
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { CMOptions } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function toggles the upgrade to be always expanded
|
||||
* It is called by a change in CM.Options.ToolWarnPos
|
||||
* and upon creation of the warning tooltip by CM.Disp.UpdateTooltipWarnings()
|
||||
*/
|
||||
export default function ToggleUpgradeSectionsAlwaysExpanded() {
|
||||
Object.values(document.getElementsByClassName('storeSection')).forEach((section) => {
|
||||
if (CMOptions.UpgradesNeverCollapse || section.id === 'products') {
|
||||
section.style.height = 'auto'; // eslint-disable-line no-param-reassign
|
||||
} else if (section.id === 'vaultUpgrades') {
|
||||
section.style.height = '30px'; // eslint-disable-line no-param-reassign
|
||||
} else if (section.id === 'upgrades') {
|
||||
section.style.height = '60px'; // eslint-disable-line no-param-reassign
|
||||
} else {
|
||||
section.style.height = '60px'; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user