Skip to content

Commit

Permalink
feat: add module option to switch target id visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Jan 14, 2023
1 parent 5634046 commit 4264052
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ isAcceptNecessaryButtonEnabled: true
// Switch to toggle the button that opens the configuration modal.
isControlButtonEnabled: true,

// Switch to toggle the concatenation of target cookie ids to the cookie description.
isCookieIdVisible: false,

// Switch to toggle the inclusion of this module's css.
// If css is set to false, you will still be able to access your color variables.
isCssEnabled: true,
Expand Down
7 changes: 6 additions & 1 deletion src/runtime/components/CookieControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@
<span v-if="cookie.description">
{{ getDescription(cookie.description) }}
</span>
<span v-if="cookie.targetCookieIds">
<span
v-if="
moduleOptions.isCookieIdVisible &&
cookie.targetCookieIds
"
>
{{
' IDs: ' +
cookie.targetCookieIds
Expand Down
2 changes: 2 additions & 0 deletions src/runtime/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface ModuleOptions {
cookieNameCookiesEnabledIds: string
isAcceptNecessaryButtonEnabled?: boolean
isControlButtonEnabled?: boolean
isCookieIdVisible?: boolean
isCssEnabled?: boolean
isCssPolyfillEnabled?: boolean
isDashInDescriptionEnabled?: boolean
Expand Down Expand Up @@ -118,6 +119,7 @@ export const DEFAULTS: Required<ModuleOptions> = {
cookieNameCookiesEnabledIds: 'cookie_control_cookies_enabled_ids',
isAcceptNecessaryButtonEnabled: true,
isControlButtonEnabled: true,
isCookieIdVisible: false,
isCssEnabled: true,
isCssPolyfillEnabled: true,
isDashInDescriptionEnabled: true,
Expand Down

0 comments on commit 4264052

Please sign in to comment.