Config option to make upgrade bar sticky (#323)
Option to make Upgrade Bar sticky
This commit is contained in:
11
src/Disp.js
11
src/Disp.js
@@ -603,6 +603,7 @@ CM.Disp.CreateUpgradeBar = function() {
|
||||
CM.Disp.UpgradeBar.style.textAlign = 'center';
|
||||
CM.Disp.UpgradeBar.style.fontWeight = 'bold';
|
||||
CM.Disp.UpgradeBar.style.display = 'none';
|
||||
CM.Disp.UpgradeBar.style.zIndex = '21';
|
||||
CM.Disp.UpgradeBar.onmouseout = function() { Game.tooltip.hide(); };
|
||||
|
||||
var placeholder = document.createElement('div');
|
||||
@@ -736,6 +737,16 @@ CM.Disp.UpdateColors = function() {
|
||||
CM.Disp.UpdateBuildings(); // Class has been already set
|
||||
}
|
||||
|
||||
CM.Disp.ToggleUpgradeBarFixedPos = function() {
|
||||
if (CM.Config.UpgradeBarFixedPos() == 1) {
|
||||
CM.Disp.UpgradeBar.style.position = 'sticky';
|
||||
CM.Disp.UpgradeBar.style.top = '0px';
|
||||
}
|
||||
else {
|
||||
CM.Disp.UpgradeBar.style.position = '';
|
||||
}
|
||||
}
|
||||
|
||||
CM.Disp.CreateWhiteScreen = function() {
|
||||
CM.Disp.WhiteScreen = document.createElement('div');
|
||||
CM.Disp.WhiteScreen.id = 'CMWhiteScreen';
|
||||
|
||||
Reference in New Issue
Block a user