You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/UI/Artist/Editor/Organize/OrganizeFilesView.js

33 lines
974 B

var _ = require('underscore');
var vent = require('vent');
var Backbone = require('backbone');
var Marionette = require('marionette');
var CommandController = require('../../../Commands/CommandController');
module.exports = Marionette.ItemView.extend({
template : 'Artist/Editor/Organize/OrganizeFilesViewTemplate',
events : {
'click .x-confirm-organize' : '_organize'
},
initialize : function(options) {
this.artist = options.artist;
this.templateHelpers = {
numberOfArtists : this.artist.length,
artist : new Backbone.Collection(this.artist).toJSON()
};
},
_organize : function() {
var artistIds = _.pluck(this.artist, 'id');
CommandController.Execute('renameArtist', {
name : 'renameArtist',
artistIds : artistIds
});
this.trigger('organizingFiles');
vent.trigger(vent.Commands.CloseModalCommand);
}
});