(function(){RB.Config={};RB.Config.ResourceListItem=Djblets.Config.ListItem.extend({defaults:_.defaults({resource:null},Djblets.Config.ListItem.prototype.defaults),syncAttrs:[],initialize:function(options){var resource=this.get("resource");if(resource){this.set(_.pick(resource.attributes,this.syncAttrs))}else{resource=this.createResource(_.extend({id:this.get("id")},_.pick(this.attributes,this.syncAttrs)));this.set("resource",resource)}this.resource=resource;Djblets.Config.ListItem.prototype.initialize.call(this,options);this.listenTo(resource,"request",function(){this.trigger("request")});this.listenTo(resource,"sync",function(){this.trigger("sync")});this.listenTo(resource,"destroy",this.destroy);_.each(this.syncAttrs,function(attr){this.listenTo(resource,"change:"+attr,function(model,value){this.set(attr,value)})},this)},createResource:function(){console.assert(false,"createResource must be implemented")},destroy:function(options){this.stopListening(this.resource);this.trigger("destroy",this,this.collection,options);if(options&&options.success){options.success(this,null,options)}}})}).call(this);