Skip to content

Commit 63b2f8e

Browse files
committed
feat(code_editor): add option to disable storing the code on change
1 parent 3f7fc91 commit 63b2f8e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/modules/types/client_interaction/code_editor/controller.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ define(['modules/default/defaultcontroller', 'src/data/structures'], function (D
100100
},
101101
default: []
102102
},
103+
storeOnChange: {
104+
title: 'On change',
105+
type: 'checkbox',
106+
options: {
107+
store: 'Store value in the preferences on change'
108+
},
109+
default: ['store']
110+
},
103111
debouncing: {
104112
title: 'Debouncing',
105113
type: 'float',
@@ -124,6 +132,7 @@ define(['modules/default/defaultcontroller', 'src/data/structures'], function (D
124132
script: ['groups', 'group', 0, 'script', 0],
125133
outputType: ['groups', 'group', 0, 'outputType', 0],
126134
variable: ['groups', 'group', 0, 'variable', 0],
135+
storeOnChange: ['groups', 'group', 0, 'storeOnChange', 0],
127136
debouncing: ['groups', 'group', 0, 'debouncing', 0]
128137
};
129138

src/modules/types/client_interaction/code_editor/view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ define(['modules/default/defaultview', 'src/util/util', 'ace/ace', 'src/util/con
7979
editorChanged: function () {
8080
var val = this.editor.getValue();
8181
this._code = val;
82-
if (this.module.definition.configuration.groups) {
82+
if (this.module.getConfigurationCheckbox('storeOnChange', 'store') && this.module.definition.configuration.groups) {
8383
this.module.definition.configuration.groups.group[0].script[0] = val;
8484
}
8585
this.module.controller.onEditorChanged(this._code);

0 commit comments

Comments
 (0)