Skip to content

Commit

Permalink
exlude classes support comma separator
Browse files Browse the repository at this point in the history
  • Loading branch information
jemikanegara committed Apr 17, 2024
1 parent 320a97d commit fc0658b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ if (isBrowser) {
const useBrowserLanguage = useBrowserLanguageAttr != "false" && useBrowserLanguageAttr != false;

// exclude classes
const excludeClasses = (window.weployScriptTag.getAttribute("data-exclude-classes") || "").trim().split(" ");
const excludeClassesAttr = (window.weployScriptTag.getAttribute("data-exclude-classes") || "").trim()
const excludeClassesByComma = excludeClassesAttr.split(",").filter(className => !!className).map(className => className.trim());
const excludeClassesBySpace = excludeClassesAttr.split(" ").filter(className => !!className).map(className => className.trim().replaceAll(",", ""));
const mergedExcludeClasses = [...excludeClassesByComma, ...excludeClassesBySpace];
const excludeClasses = [...new Set(mergedExcludeClasses)]; // get unique values

// timeout
const timeoutAttr = window.weployScriptTag.getAttribute("data-timeout");
Expand Down

0 comments on commit fc0658b

Please sign in to comment.