-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(form-builder): save the preference for "show advanced" settings (#…
- Loading branch information
1 parent
3e1fd86
commit 3694054
Showing
2 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |