diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-28 12:37:42 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-28 12:37:42 +0100 |
commit | 7c1309ea483b21cb2f97a509b61cb3363de8edb8 (patch) | |
tree | 1fe9a481aa7bac344b331519f954e1c7dbe2d283 /module/web/static/js/models/ConfigItem.js | |
parent | working reset button for config (diff) | |
download | pyload-7c1309ea483b21cb2f97a509b61cb3363de8edb8.tar.xz |
client side settings save, working dl button on dashboard
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 |