Files
Readarr/src/UI/Settings/DownloadClient/DownloadClientLayout.js
2014-02-16 23:01:36 -08:00

40 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use strict';
define(
[
'marionette',
'Settings/DownloadClient/DownloadClientCollection',
'Settings/DownloadClient/DownloadClientCollectionView',
'Mixins/AsModelBoundView',
'Mixins/AutoComplete',
'bootstrap'
], function (Marionette, DownloadClientCollection, DownloadClientCollectionView, AsModelBoundView) {
var view = Marionette.Layout.extend({
template : 'Settings/DownloadClient/DownloadClientLayoutTemplate',
regions: {
downloadClients: '#x-download-clients-region'
},
ui: {
droneFactory: '.x-path'
},
events: {
'change .x-download-client': 'downloadClientChanged'
},
initialize: function () {
this.downloadClientCollection = new DownloadClientCollection();
this.downloadClientCollection.fetch();
},
onShow: function () {
this.downloadClients.show(new DownloadClientCollectionView({ collection: this.downloadClientCollection }));
this.ui.droneFactory.autoComplete('/directories');
}
});
return AsModelBoundView.call(view);
});