mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-17 21:25:39 -04:00
New: Manual Import episodes
This commit is contained in:
49
src/UI/ManualImport/Folder/SelectFolderView.js
Normal file
49
src/UI/ManualImport/Folder/SelectFolderView.js
Normal file
@@ -0,0 +1,49 @@
|
||||
var Marionette = require('marionette');
|
||||
require('../../Mixins/FileBrowser');
|
||||
|
||||
module.exports = Marionette.ItemView.extend({
|
||||
template : 'ManualImport/Folder/SelectFolderViewTemplate',
|
||||
|
||||
ui : {
|
||||
path : '.x-path',
|
||||
buttons : '.x-button'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-manual-import' : '_manualImport',
|
||||
'click .x-automatic-import' : '_automaticImport',
|
||||
'change .x-path' : '_updateButtons',
|
||||
'keyup .x-path' : '_updateButtons'
|
||||
},
|
||||
|
||||
onRender : function() {
|
||||
this.ui.path.fileBrowser();
|
||||
this._updateButtons();
|
||||
},
|
||||
|
||||
path : function() {
|
||||
return this.ui.path.val();
|
||||
},
|
||||
|
||||
_manualImport : function () {
|
||||
if (this.ui.path.val()) {
|
||||
this.trigger('manualImport', { folder: this.ui.path.val() });
|
||||
}
|
||||
},
|
||||
|
||||
_automaticImport : function () {
|
||||
if (this.ui.path.val()) {
|
||||
this.trigger('automaticImport', { folder: this.ui.path.val() });
|
||||
}
|
||||
},
|
||||
|
||||
_updateButtons : function () {
|
||||
if (this.ui.path.val()) {
|
||||
this.ui.buttons.removeAttr('disabled');
|
||||
}
|
||||
|
||||
else {
|
||||
this.ui.buttons.attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user