Skip to content

Commit

Permalink
Merge pull request #6 from caseydwyer/enhancement-active-class-withou…
Browse files Browse the repository at this point in the history
…t-toggle

Enhancement: Apply active class when viz-toggle not in use
  • Loading branch information
eminos authored Oct 12, 2023
2 parents a936f08 + 499b898 commit aedcd67
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion dist/build/assets/statamic-group-063c37d4.js

This file was deleted.

1 change: 1 addition & 0 deletions dist/build/assets/statamic-group-734987da.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"src": "resources/css/statamic-group.css"
},
"resources/js/statamic-group.js": {
"file": "assets/statamic-group-063c37d4.js",
"file": "assets/statamic-group-734987da.js",
"isEntry": true,
"src": "resources/js/statamic-group.js"
}
Expand Down
10 changes: 8 additions & 2 deletions resources/js/components/GroupFieldtype.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<div class="form-group section-fieldtype w-full" :class="{'active': toggle}" v-if="config.show_header">
<div class="form-group section-fieldtype w-full" :class="{'active': showFields}" v-if="config.show_header">
<div class="flex grp-justify-between grp-items-center">
<div class="field-inner">
<label class="publish-field-label">
Expand All @@ -13,7 +13,7 @@
</div>
</div>
</div>
<div class="publish-fields w-full" v-show="!config.toggle_controls_visibility || (config.toggle_controls_visibility && toggle)"></div>
<div class="publish-fields w-full" v-show="showFields"></div>
</div>
</template>

Expand All @@ -36,6 +36,12 @@ export default {
}
},
computed: {
showFields(){
return ! this.config.toggle_controls_visibility || (this.config.toggle_controls_visibility && this.toggle);
}
},
mounted() {
if (this.config.save_toggle_state) {
this.toggle = this.value
Expand Down

0 comments on commit aedcd67

Please sign in to comment.