Complete overhaul of code structure and relevant files (#639)
This commit is contained in:
20
src/Config/Toggles/ToggleToolWarnPos.js
Normal file
20
src/Config/Toggles/ToggleToolWarnPos.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { CMOptions } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function toggles the position of the warnings created by CM.Disp.TooltipCreateWarningSection()
|
||||
* It is called by a change in CM.Options.ToolWarnPos
|
||||
* and upon creation of the warning tooltip by CM.Disp.UpdateTooltipWarnings()
|
||||
*/
|
||||
export default function ToggleToolWarnPos() {
|
||||
if (l('CMDispTooltipWarningParent') !== null) {
|
||||
if (CMOptions.ToolWarnPos === 0) {
|
||||
l('CMDispTooltipWarningParent').style.top = 'auto';
|
||||
l('CMDispTooltipWarningParent').style.margin = '4px -4px';
|
||||
l('CMDispTooltipWarningParent').style.padding = '3px 4px';
|
||||
} else {
|
||||
l('CMDispTooltipWarningParent').style.right = 'auto';
|
||||
l('CMDispTooltipWarningParent').style.margin = '4px';
|
||||
l('CMDispTooltipWarningParent').style.padding = '4px 3px';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user