mirror of
https://github.com/Readarr/Readarr
synced 2026-02-13 18:22:59 +01:00
33 lines
989 B
JavaScript
33 lines
989 B
JavaScript
'use strict';
|
|
define(
|
|
[
|
|
'marionette',
|
|
'backgrid',
|
|
'System/Update/UpdateCollection',
|
|
'System/Update/UpdateCollectionView',
|
|
'Shared/LoadingView'
|
|
], function (Marionette, Backgrid, UpdateCollection, UpdateCollectionView, LoadingView) {
|
|
return Marionette.Layout.extend({
|
|
template: 'System/Update/UpdateLayoutTemplate',
|
|
|
|
regions: {
|
|
updates: '#x-updates'
|
|
},
|
|
|
|
initialize: function () {
|
|
this.updateCollection = new UpdateCollection();
|
|
|
|
this.listenTo(this.updateCollection, 'sync', this._showUpdates);
|
|
},
|
|
|
|
onRender: function () {
|
|
this.updates.show(new LoadingView());
|
|
|
|
this.updateCollection.fetch();
|
|
},
|
|
|
|
_showUpdates: function () {
|
|
this.updates.show(new UpdateCollectionView({ collection: this.updateCollection }));
|
|
}
|
|
});
|
|
});
|