mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-01 18:45:13 -04:00
UI Cleanup - Updated Settings subtree.
This commit is contained in:
@@ -9,14 +9,20 @@ module.exports = Marionette.CompositeView.extend({
|
||||
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingCollectionViewTemplate',
|
||||
itemViewContainer : '.x-rows',
|
||||
itemView : RemotePathMappingItemView,
|
||||
events : {"click .x-add" : '_addMapping'},
|
||||
_addMapping : function(){
|
||||
|
||||
events : {
|
||||
'click .x-add' : '_addMapping'
|
||||
},
|
||||
|
||||
_addMapping : function() {
|
||||
var model = new RemotePathMappingModel();
|
||||
model.collection = this.collection;
|
||||
|
||||
var view = new EditView({
|
||||
model : model,
|
||||
targetCollection : this.collection
|
||||
});
|
||||
|
||||
AppLayout.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
@@ -3,11 +3,15 @@ var Marionette = require('marionette');
|
||||
|
||||
module.exports = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingDeleteViewTemplate',
|
||||
events : {"click .x-confirm-delete" : '_delete'},
|
||||
_delete : function(){
|
||||
|
||||
events : {
|
||||
'click .x-confirm-delete' : '_delete'
|
||||
},
|
||||
|
||||
_delete : function() {
|
||||
this.model.destroy({
|
||||
wait : true,
|
||||
success : function(){
|
||||
success : function() {
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,30 +10,36 @@ var AsEditModalView = require('../../../Mixins/AsEditModalView');
|
||||
require('../../../Mixins/FileBrowser');
|
||||
require('bootstrap');
|
||||
|
||||
module.exports = (function(){
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingEditViewTemplate',
|
||||
ui : {
|
||||
path : '.x-path',
|
||||
modalBody : '.modal-body'
|
||||
},
|
||||
_deleteView : DeleteView,
|
||||
initialize : function(options){
|
||||
this.targetCollection = options.targetCollection;
|
||||
},
|
||||
onShow : function(){
|
||||
if(this.ui.path.length > 0) {
|
||||
this.ui.modalBody.addClass('modal-overflow');
|
||||
}
|
||||
this.ui.path.fileBrowser();
|
||||
},
|
||||
_onAfterSave : function(){
|
||||
this.targetCollection.add(this.model, {merge : true});
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingEditViewTemplate',
|
||||
|
||||
ui : {
|
||||
path : '.x-path',
|
||||
modalBody : '.modal-body'
|
||||
},
|
||||
|
||||
_deleteView : DeleteView,
|
||||
|
||||
initialize : function(options) {
|
||||
this.targetCollection = options.targetCollection;
|
||||
},
|
||||
|
||||
onShow : function() {
|
||||
if (this.ui.path.length > 0) {
|
||||
this.ui.modalBody.addClass('modal-overflow');
|
||||
}
|
||||
});
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
AsEditModalView.call(view);
|
||||
return view;
|
||||
}).call(this);
|
||||
|
||||
this.ui.path.fileBrowser();
|
||||
},
|
||||
|
||||
_onAfterSave : function() {
|
||||
this.targetCollection.add(this.model, { merge : true });
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
}
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
AsEditModalView.call(view);
|
||||
|
||||
module.exports = view;
|
||||
@@ -3,17 +3,23 @@ var Marionette = require('marionette');
|
||||
var EditView = require('./RemotePathMappingEditView');
|
||||
|
||||
module.exports = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingItemViewTemplate',
|
||||
className : 'row',
|
||||
events : {"click .x-edit" : '_editMapping'},
|
||||
initialize : function(){
|
||||
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingItemViewTemplate',
|
||||
className : 'row',
|
||||
|
||||
events : {
|
||||
'click .x-edit' : '_editMapping'
|
||||
},
|
||||
|
||||
initialize : function() {
|
||||
this.listenTo(this.model, 'sync', this.render);
|
||||
},
|
||||
_editMapping : function(){
|
||||
|
||||
_editMapping : function() {
|
||||
var view = new EditView({
|
||||
model : this.model,
|
||||
targetCollection : this.model.collection
|
||||
});
|
||||
|
||||
AppLayout.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user