Skip to content

Commit

Permalink
feat(form-builder): save the preference for "show advanced" settings (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanH90 authored Apr 23, 2024
1 parent 3e1fd86 commit 3694054
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<UkButton
@color="link"
@onClick={{toggle-action "showAdvanced" this}}
@onClick={{this.toggleAdvanced}}
class="uk-flex uk-flex-middle uk-margin"
>
{{#if this.showAdvanced}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
import { action } from "@ember/object";
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";

export default class CfbFormEditorCfbAdvancedSettings extends Component {
@tracked showAdvanced = false;

constructor(owner, args) {
super(owner, args);

this.showAdvanced =
JSON.parse(localStorage.getItem("showAdvanced")) ?? false;
}

@action
toggleAdvanced() {
this.showAdvanced = !this.showAdvanced;

localStorage.setItem("showAdvanced", this.showAdvanced);
}
}

0 comments on commit 3694054

Please sign in to comment.