move escapeCSS function to mixins

This commit is contained in:
tomtjes
2024-02-15 14:56:04 -05:00
parent b5a204265a
commit f34dc4d242
4 changed files with 16 additions and 19 deletions

View File

@@ -317,8 +317,13 @@ export function calculateAmount(amount, factor) {
}
}
export function escapeCSS(classname) {
return classname.replace(/\s+/g, "-").toLowerCase()
/* Replace spaces by dashes, then use DOM method to escape special characters. Use for dynamically generated CSS classes*/
export const EscapeCSSMixin = {
methods: {
escapeCSS: function(classname) {
return CSS.escape(classname.replace(/\s+/g, "-").toLowerCase())
}
}
}
export function roundDecimals(num) {