Commit 1a92db89 authored by JC Brand's avatar JC Brand

Override save on ChatBox to not persist the 'trimmed' attribute

parent 0c0a3f86
......@@ -662,6 +662,24 @@
}
},
save: function(key, val, options) {
/* Override the backbone function and exclude the 'trimmed'
* attribute from being persisted.
*/
var attrs;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || typeof key === 'object') {
attrs = key;
options = val;
} else {
(attrs = {})[key] = val;
}
if (typeof attrs === 'object') {
delete attrs.trimmed;
}
Backbone.Model.prototype.save.call(this, attrs, options);
},
getSession: function (callback) {
var cipher = CryptoJS.lib.PasswordBasedCipher;
var result, pass, instance_tag, saved_key, pass_check;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment