You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
11 years ago
|
'use strict';
|
||
|
define(
|
||
|
[
|
||
|
'app',
|
||
|
'marionette',
|
||
|
'Series/Edit/EditSeriesView',
|
||
|
'Series/Delete/DeleteSeriesView',
|
||
|
'Episode/Layout'
|
||
|
|
||
|
], function (App, Marionette, EditSeriesView, DeleteSeriesView, EpisodeLayout) {
|
||
|
|
||
|
var router = Marionette.AppRouter.extend({
|
||
|
|
||
|
initialize: function () {
|
||
|
App.vent.on(App.Commands.CloseModalCommand, this._closeModal, this);
|
||
|
App.vent.on(App.Commands.EditSeriesCommand, this._editSeries, this);
|
||
|
App.vent.on(App.Commands.DeleteSeriesCommand, this._deleteSeries, this);
|
||
|
App.vent.on(App.Commands.ShowEpisodeDetails, this._showEpisode, this);
|
||
|
},
|
||
|
|
||
|
_closeModal: function () {
|
||
|
App.vent.trigger(App.Commands.CloseModalCommand);
|
||
|
},
|
||
|
|
||
|
_editSeries: function (options) {
|
||
|
var view = new EditSeriesView({ model: options.model });
|
||
|
App.modalRegion.show(view);
|
||
|
},
|
||
|
|
||
|
_deleteSeries: function (options) {
|
||
|
var view = new DeleteSeriesView({ model: options.model });
|
||
|
App.modalRegion.show(view);
|
||
|
},
|
||
|
|
||
|
_showEpisode: function (options) {
|
||
|
var view = new EpisodeLayout({ model: options.model });
|
||
|
App.modalRegion.show(view);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return new router();
|
||
|
});
|