}
function whitespaceDisplay(checked) {
- if (checked) {
- globalThis.tdSqltextSheet.disabled = false;
- } else {
- globalThis.tdSqltextSheet.disabled = true;
- }
+ const whitespace_sheet = document.getElementById(
+ 'stylesheet_show_whitespace_id');
+ if (checked) {
+ whitespace_sheet.removeAttribute('disabled');
+ } else {
+ whitespace_sheet.setAttribute('disabled', '');
+ }
}
function rulesDisplay(checked) {
- if (checked) {
- globalThis.horizontalRuleSheet.disabled = false;
- } else {
- globalThis.horizontalRuleSheet.disabled = true;
- }
+ const rule_sheet = document.getElementById(
+ 'stylesheet_background_rules_id');
+ if (checked) {
+ rule_sheet.removeAttribute('disabled');
+ } else {
+ rule_sheet.setAttribute('disabled', '');
+ }
}
/* Functions for initialization */
}
/* Initialization */
-globalThis.tdSqltextSheet = getSheet(pgwuiSqlShowWhitespaceURL());
-globalThis.horizontalRuleSheet = getSheet(pgwuiSqlBackgroundRulesURL());
attachEvents();
/* This is redundent, since styling on load should be right,
but it does not hurt and is needed to properly style should the checkbox
<%block name="stylesheet_links">
${parent.stylesheet_links()}
<link rel="stylesheet"
+ id="stylesheet_show_whitespace_id"
disabled
href="${request.static_path('pgwui_sql:static/show_whitespace.css')}"
type="text/css" />
<link rel="stylesheet"
+ id="stylesheet_background_rules_id"
disabled
href="${request.static_path('pgwui_sql:static/background_rules.css')}"
type="text/css" />