Anton Shestakov <av6@dwimlabs.net>, Tue, 19 Jul 2016 17:51:59 +0800
tests: pass data to create_resource() and update_resource() explicitly
static/js/framework/models.js
Permissions: -rw-r--r--
var Model = Backbone.Model.extend({ var url = Backbone.Model.prototype.url.call(this); return url[url.length - 1] == '/' ? url : url + '/'; contentType: 'application/json', data: JSON.stringify(data) return (this.sync || Backbone.sync).call(this, 'update', model, options).then(function(serverAttrs) { var Workspace = Backbone.Model.extend({ var Project = Model.extend({ switchColor: function() { var colorChain = [null, 'info', 'success', 'warning', 'danger']; var currentColorIndex = colorChain.indexOf(this.get('color') || null); var nextColor = colorChain[(currentColorIndex + 1) % colorChain.length]; return this.adhoc({color: nextColor}); var Task = Model.extend({