summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/vendor/view/serializable.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/vendor/view/serializable.js')
-rw-r--r--StoneIsland/www/js/vendor/view/serializable.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/StoneIsland/www/js/vendor/view/serializable.js b/StoneIsland/www/js/vendor/view/serializable.js
index 83c7cdc3..a2ff1147 100644
--- a/StoneIsland/www/js/vendor/view/serializable.js
+++ b/StoneIsland/www/js/vendor/view/serializable.js
@@ -4,6 +4,28 @@ var SerializableView = View.extend({
"change select": "update_select",
"focus input": "focus_input",
},
+
+ preload: function(){
+ if (sdk.env == "production") { return }
+
+ this.test_data['ConfirmEmail'] = this.test_data['Email']
+ Object.keys(this.test_data).forEach(function(key){
+
+ var value = this.test_data[key]
+ var $el = this.$("[name=" + key + "]")
+
+ if ($el.attr("type") == "checkbox") {
+ $el.prop("checked", value)
+ }
+ else if ($el.prop("tagName") == "SELECT") {
+ $el.val( value )
+ this.update_select({ currentTarget: $el })
+ }
+ else {
+ $el.val( value )
+ }
+ }.bind(this))
+ },
serialize: function(){
var fields = {}