1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-27 10:07:10 +00:00
Lidarr/UI/Settings/Quality/Profile/QualityProfileView.js

44 lines
1.3 KiB
JavaScript
Raw Normal View History

2013-06-25 04:43:16 +00:00
'use strict';
define(
[
'app',
'marionette',
'Settings/Quality/Profile/EditQualityProfileView',
'Settings/Quality/Profile/DeleteView',
2013-06-25 00:41:32 +00:00
'Mixins/AsModelBoundView',
'Settings/Quality/Profile/AllowedLabeler'
], function (App, Marionette, EditProfileView, DeleteProfileView, AsModelBoundView) {
var view = Marionette.ItemView.extend({
template: 'Settings/Quality/Profile/QualityProfileTemplate',
2013-06-25 00:41:32 +00:00
tagName : 'li',
ui: {
'progressbar': '.progress .bar'
},
events: {
2013-06-25 00:41:32 +00:00
'click .x-edit' : '_editProfile',
'click .x-delete': '_deleteProfile'
},
initialize: function () {
this.listenTo(this.model, 'sync', this.render);
},
2013-06-25 00:41:32 +00:00
_editProfile: function () {
var view = new EditProfileView({ model: this.model, profileCollection: this.model.collection });
App.modalRegion.show(view);
},
2013-06-25 00:41:32 +00:00
_deleteProfile: function () {
var view = new DeleteProfileView({ model: this.model });
App.modalRegion.show(view);
}
});
return AsModelBoundView.call(view);
});