Sonarr/NzbDrone.Web/Scripts/backbone/views/qualityProfiles.js

33 lines
1015 B
JavaScript
Raw Normal View History

2012-11-09 16:28:59 +00:00
QualityProfileView = Backbone.Marionette.ItemView.extend({
tagName: "div",
className: "quality-profile",
2012-11-24 08:03:38 +00:00
template: "#QualityProfileTemplate",
events: {
'click .quality-selectee': 'toggleAllowed'
},
toggleAllowed: function (e) {
//Add to cutoff
//Update model
var checked = $(e.target).attr('checked') != undefined;
this.model.set({ });
}
2012-11-07 00:41:34 +00:00
});
2012-11-09 16:28:59 +00:00
QualityProfileCollectionView = Backbone.Marionette.CompositeView.extend({
tagName: "div",
id: "quality-profile-collection",
itemView: QualityProfileView,
template: QualityProfileApp.Constants.Templates.QualityProfileCollection,
//appendHtml: function (collectionView, itemView) {
// collectionView.$('#collection').append(itemView.el);
//},
2012-11-07 00:41:34 +00:00
initialize: function () {
2012-11-09 16:28:59 +00:00
_.bindAll(this, 'render');
this.collection = new QualityProfileCollection();
this.collection.fetch();
this.collection.bind('reset', this.render);
2012-11-07 00:41:34 +00:00
}
});