mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Beginning of Add New Profile button
This commit is contained in:
parent
ecab574042
commit
ae8db51839
7 changed files with 81 additions and 20 deletions
|
@ -1,17 +1,5 @@
|
|||
var deleteQualityProfileUrl = '../../Settings/DeleteQualityProfile';
|
||||
|
||||
$(document).on("click", "#addProfile", function (event) {
|
||||
$.ajax({
|
||||
url: this.href,
|
||||
cache: false,
|
||||
success: function (html) {
|
||||
$("#profiles").append(html);
|
||||
}
|
||||
});
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$(document).on('click', '.delete-profile', function (e) {
|
||||
var container = $(this).closest('.profileSection');
|
||||
var id = $(container).attr('data-profile-id');
|
||||
|
|
|
@ -72,5 +72,13 @@ QualityProfileCollectionView = Backbone.Marionette.CompositeView.extend({
|
|||
this.collection = new QualityProfileCollection();
|
||||
this.collection.fetch();
|
||||
this.collection.bind('reset', this.render);
|
||||
},
|
||||
events: {
|
||||
'click #add-profile': 'addProfile'
|
||||
},
|
||||
addProfile: function (e) {
|
||||
//Add new profile to collection
|
||||
this.collection.add(new QualityProfile());
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue