Abstract getting a sheet with an url
authorKarl O. Pinc <kop@karlpinc.com>
Wed, 25 Sep 2024 19:07:27 +0000 (14:07 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Wed, 25 Sep 2024 19:07:27 +0000 (14:07 -0500)
src/pgwui_sql/static/pgwui_sql.js

index 230a477e54d51163b4882874cf45aba228c96178..6c943b21a567506cf774a77111726f2912e6ee0e 100644 (file)
@@ -45,8 +45,7 @@ function whitespaceDisplay(checked) {
 }
 
 /* Functions for initialization */
-function getTdSqltextSheet() {
-    const url = pgwuiSqlShowWhitespaceURL();
+function getSheet(url) {
     for (const sheet of document.styleSheets) {
         if (sheet.href === url) {
             return sheet;
@@ -64,5 +63,5 @@ function initializeStyling() {
 }
 
 /* Initialization */
-globalThis.tdSqltextSheet = getTdSqltextSheet();
+globalThis.tdSqltextSheet = getSheet(pgwuiSqlShowWhitespaceURL());
 initializeStyling();