diff --git a/fastn-js/js/dom.js b/fastn-js/js/dom.js index e75dbe2595..5ffedb52fb 100644 --- a/fastn-js/js/dom.js +++ b/fastn-js/js/dom.js @@ -2,6 +2,12 @@ let fastn_dom = {}; fastn_dom.styleClasses = ""; +fastn_dom.InternalClass = { + FT_COLUMN: 'ft_column', + FT_ROW: 'ft_row', + FULL: "full", +}; + fastn_dom.codeData = { availableThemes: {}, addedCssFile: [] diff --git a/fastn-js/js/utils.js b/fastn-js/js/utils.js index 5ec1f080e5..4348e406e4 100644 --- a/fastn-js/js/utils.js +++ b/fastn-js/js/utils.js @@ -1,16 +1,15 @@ let fastn_utils = { - ftClassNames: ["ft_column", "ft_row"], htmlNode(kind) { let node = "div"; let css = []; let attributes = {}; if (kind === fastn_dom.ElementKind.Column) { - css.push("ft_column"); + css.push(fastn_dom.InternalClass.FT_COLUMN); } else if (kind === fastn_dom.ElementKind.Document) { - css.push("ft_column"); - css.push("full"); + css.push(fastn_dom.InternalClass.FT_COLUMN); + css.push(fastn_dom.InternalClass.FULL); } else if (kind === fastn_dom.ElementKind.Row) { - css.push("ft_row"); + css.push(fastn_dom.InternalClass.FT_ROW); } else if (kind === fastn_dom.ElementKind.IFrame) { node = "iframe"; // To allow fullscreen support @@ -102,11 +101,12 @@ let fastn_utils = { if (ssr) { iterativeClassList = iterativeClassList.getClasses(); } + const internalClassNames = Object.values(fastn_dom.InternalClass); const classesToRemove = []; for (const className of iterativeClassList) { if (!className.startsWith('__') && - !this.ftClassNames.includes(className) && + !internalClassNames.includes(className) && className !== extraCodeData?.language && className !== extraCodeData?.theme ) {