Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Sonarr/blame/commit/b8bd2bffbf133f10e54b2de200f317be0a9af55a/UI/AddSeries/RootFolders/Layout.js You should set ROOT_URL correctly, otherwise the web may not work correctly.
Sonarr/UI/AddSeries/RootFolders/Layout.js

67 lines
1.9 KiB

'use strict';
12 years ago
define(
[
'marionette',
'AddSeries/RootFolders/CollectionView',
'AddSeries/RootFolders/Collection',
'AddSeries/RootFolders/Model',
12 years ago
'Shared/LoadingView',
12 years ago
'Mixins/AutoComplete'
12 years ago
], function (Marionette, RootFolderCollectionView, RootFolderCollection, RootFolderModel, LoadingView) {
12 years ago
return Marionette.Layout.extend({
template: 'AddSeries/RootFolders/LayoutTemplate',
ui: {
pathInput: '.x-path input'
},
regions: {
currentDirs: '#current-dirs'
},
events: {
'click .x-add': '_addFolder'
12 years ago
},
initialize: function () {
this.collection = RootFolderCollection;
this.rootfolderListView = new RootFolderCollectionView({ collection: RootFolderCollection });
this.listenTo(this.rootfolderListView, 'itemview:folderSelected', this._onFolderSelected);
12 years ago
},
onRender: function () {
var self = this;
12 years ago
this.currentDirs.show(new LoadingView());
RootFolderCollection.promise.done(function () {
self.currentDirs.show(self.rootfolderListView);
});
12 years ago
this.ui.pathInput.autoComplete('/directories');
},
_onFolderSelected: function (options) {
this.trigger('folderSelected', options);
},
_addFolder: function () {
var self = this;
12 years ago
var newDir = new RootFolderModel({
Path: this.ui.pathInput.val()
});
RootFolderCollection.add(newDir);
newDir.save().done(function () {
self.trigger('folderSelected', {model: newDir});
12 years ago
});
}
});
});