1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00
Files
Radarr/src/UI/Settings/Indexers/Restriction/RestrictionEditView.js
T
Mark McDowall 53c2962d2a Release restrictions
New: Required terms assignable to series via tags
New: Ignored terms assignable to series via tagss
2014-11-18 22:07:24 -08:00

62 lines
1.6 KiB
JavaScript

'use strict';
define([
'underscore',
'vent',
'AppLayout',
'marionette',
'Settings/Indexers/Restriction/RestrictionDeleteView',
'Commands/CommandController',
'Mixins/AsModelBoundView',
'Mixins/AsValidatedView',
'Mixins/AsEditModalView',
'Mixins/TagInput',
'bootstrap',
'bootstrap.tagsinput'
], function (_, vent, AppLayout, Marionette, DeleteView, CommandController, AsModelBoundView, AsValidatedView, AsEditModalView) {
var view = Marionette.ItemView.extend({
template : 'Settings/Indexers/Restriction/RestrictionEditViewTemplate',
ui : {
required : '.x-required',
ignored : '.x-ignored',
tags : '.x-tags'
},
_deleteView: DeleteView,
initialize : function (options) {
this.targetCollection = options.targetCollection;
},
onRender : function () {
this.ui.required.tagsinput({
trimValue : true,
tagClass : 'label label-success'
});
this.ui.ignored.tagsinput({
trimValue : true,
tagClass : 'label label-danger'
});
this.ui.tags.tagInput({
model : this.model,
property : 'tags'
});
},
_onAfterSave : function () {
this.targetCollection.add(this.model, { merge : true });
vent.trigger(vent.Commands.CloseModalCommand);
}
});
AsModelBoundView.call(view);
AsValidatedView.call(view);
AsEditModalView.call(view);
return view;
});