mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
UI Cleanup - Updated Settings subtree.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var vent = require('vent');
|
||||
var vent = require('vent');
|
||||
var Marionette = require('marionette');
|
||||
var DeleteView = require('../Delete/DownloadClientDeleteView');
|
||||
var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
|
||||
@@ -8,40 +8,49 @@ require('../../../Form/FormBuilder');
|
||||
require('../../../Mixins/FileBrowser');
|
||||
require('bootstrap');
|
||||
|
||||
module.exports = (function(){
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/Edit/DownloadClientEditViewTemplate',
|
||||
ui : {
|
||||
path : '.x-path',
|
||||
modalBody : '.modal-body'
|
||||
},
|
||||
events : {
|
||||
'click .x-back' : '_back'
|
||||
},
|
||||
_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);
|
||||
},
|
||||
_onAfterSaveAndAdd : function(){
|
||||
this.targetCollection.add(this.model, {merge : true});
|
||||
require('../Add/DownloadClientSchemaModal').open(this.targetCollection);
|
||||
},
|
||||
_back : function(){
|
||||
require('../Add/DownloadClientSchemaModal').open(this.targetCollection);
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/Edit/DownloadClientEditViewTemplate',
|
||||
|
||||
ui : {
|
||||
path : '.x-path',
|
||||
modalBody : '.modal-body'
|
||||
},
|
||||
|
||||
events : {
|
||||
'click .x-back' : '_back'
|
||||
},
|
||||
|
||||
_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);
|
||||
},
|
||||
|
||||
_onAfterSaveAndAdd : function() {
|
||||
this.targetCollection.add(this.model, { merge : true });
|
||||
|
||||
require('../Add/DownloadClientSchemaModal').open(this.targetCollection);
|
||||
},
|
||||
_back : function() {
|
||||
require('../Add/DownloadClientSchemaModal').open(this.targetCollection);
|
||||
}
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
AsEditModalView.call(view);
|
||||
|
||||
module.exports = view;
|
||||
Reference in New Issue
Block a user