Sha256: eace5b7b34ba0cbe5ce1100bcb75a819a8256becdb72df3814b200c3685ae755
Contents?: true
Size: 914 Bytes
Versions: 18
Compression:
Stored size: 914 Bytes
Contents
define(["model/base","backbone-mediator"],function(e){var t=e.extend({url:"/user.json",defaults:{id:null,email:"",firstName:"",lastName:"",lastLogin:null,createdAt:null,modifiedAt:null,preferences:{}},parse:function(e){return e.createdAt&&(e.createdAt=this.formatServerDateTime(e.createdAt)),e.modifiedAt&&(e.modifiedAt=this.formatServerDateTime(e.modifiedAt)),e.preferences||(e.preferences={},e.preferences.dashboards||(e.preferences.dashboards=[])),e},convertApplicationPrefs:function(){var e=this.get("preferences");e.applications&&(e.dashboards=e.applications,this.set("preferences",e),delete e.applications,this.save())},updatePrefs:function(e){var t=this.get("preferences");this.set("preferences",_.extend(t,e)),this.save()},initialize:function(){_.bindAll(this),this.fetch({async:!1,success:function(){this.convertApplicationPrefs(),Backbone.Mediator.pub("model:user:init",this)}.bind(this)})}});return t});
Version data entries
18 entries across 18 versions & 1 rubygems