mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
UI Cleanup - Updated Series subtree.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var vent = require('vent');
|
||||
var vent = require('vent');
|
||||
var Marionette = require('marionette');
|
||||
var Profiles = require('../../Profile/ProfileCollection');
|
||||
var AsModelBoundView = require('../../Mixins/AsModelBoundView');
|
||||
@@ -7,39 +7,48 @@ var AsEditModalView = require('../../Mixins/AsEditModalView');
|
||||
require('../../Mixins/TagInput');
|
||||
require('../../Mixins/FileBrowser');
|
||||
|
||||
module.exports = (function(){
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Series/Edit/EditSeriesViewTemplate',
|
||||
ui : {
|
||||
profile : '.x-profile',
|
||||
path : '.x-path',
|
||||
tags : '.x-tags'
|
||||
},
|
||||
events : {"click .x-remove" : '_removeSeries'},
|
||||
initialize : function(){
|
||||
this.model.set('profiles', Profiles);
|
||||
},
|
||||
onRender : function(){
|
||||
this.ui.path.fileBrowser();
|
||||
this.ui.tags.tagInput({
|
||||
model : this.model,
|
||||
property : 'tags'
|
||||
});
|
||||
},
|
||||
_onBeforeSave : function(){
|
||||
var profileId = this.ui.profile.val();
|
||||
this.model.set({profileId : profileId});
|
||||
},
|
||||
_onAfterSave : function(){
|
||||
this.trigger('saved');
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
},
|
||||
_removeSeries : function(){
|
||||
vent.trigger(vent.Commands.DeleteSeriesCommand, {series : this.model});
|
||||
}
|
||||
});
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
AsEditModalView.call(view);
|
||||
return view;
|
||||
}).call(this);
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Series/Edit/EditSeriesViewTemplate',
|
||||
|
||||
ui : {
|
||||
profile : '.x-profile',
|
||||
path : '.x-path',
|
||||
tags : '.x-tags'
|
||||
},
|
||||
|
||||
events : {
|
||||
'click .x-remove' : '_removeSeries'
|
||||
},
|
||||
|
||||
initialize : function() {
|
||||
this.model.set('profiles', Profiles);
|
||||
},
|
||||
|
||||
onRender : function() {
|
||||
this.ui.path.fileBrowser();
|
||||
this.ui.tags.tagInput({
|
||||
model : this.model,
|
||||
property : 'tags'
|
||||
});
|
||||
},
|
||||
|
||||
_onBeforeSave : function() {
|
||||
var profileId = this.ui.profile.val();
|
||||
this.model.set({ profileId : profileId });
|
||||
},
|
||||
|
||||
_onAfterSave : function() {
|
||||
this.trigger('saved');
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
},
|
||||
|
||||
_removeSeries : function() {
|
||||
vent.trigger(vent.Commands.DeleteSeriesCommand, { series : this.model });
|
||||
}
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
AsEditModalView.call(view);
|
||||
|
||||
module.exports = view;
|
Reference in New Issue
Block a user