diff options
Diffstat (limited to 'module/web/static/js/models/ConfigItem.js')
-rw-r--r-- | module/web/static/js/models/ConfigItem.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/module/web/static/js/models/ConfigItem.js b/module/web/static/js/models/ConfigItem.js index 636c28851..01a85c6cc 100644 --- a/module/web/static/js/models/ConfigItem.js +++ b/module/web/static/js/models/ConfigItem.js @@ -8,7 +8,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'], label: "", description: "", input: null, - default_valie: null, + default_value: null, value: null, // additional attributes inputView: null @@ -21,6 +21,19 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'], isChanged: function() { return this.get('inputView') && this.get('inputView').getVal() !== this.get('value'); + }, + + // set new value and return json + prepareSave: function() { + // set the new value + if (this.get('inputView')) + this.set('value', this.get('inputView').getVal()); + + var data = this.toJSON(); + delete data.inputView; + delete data.description; + + return data; } }); });
\ No newline at end of file |