Fixed issues with edit/delete series modal.

pull/4/head
kay.one 12 years ago
parent 62cea8de5e
commit 437a28c10d

@ -7,7 +7,7 @@ define(
'moment', 'moment',
'Calendar/Collection', 'Calendar/Collection',
'fullcalendar' 'fullcalendar'
], function (App, Marionette, Moment, CalendarCollection, EpisodeLayout) { ], function (App, Marionette, Moment, CalendarCollection) {
var _instance; var _instance;
@ -37,8 +37,7 @@ define(
$(element).children('.fc-event-inner').addClass(event.statusLevel); $(element).children('.fc-event-inner').addClass(event.statusLevel);
}, },
eventClick : function (event) { eventClick : function (event) {
var view = new EpisodeLayout({ model: event.model }); App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: event.model});
App.modalRegion.show(view);
} }
}); });

@ -3,20 +3,18 @@
define( define(
[ [
'app', 'app',
'marionette', 'marionette'
'Episode/Layout' ], function (App, Marionette) {
], function (App, Marionette, EpisodeLayout) {
return Marionette.ItemView.extend({ return Marionette.ItemView.extend({
template: 'Calendar/UpcomingItemTemplate', template: 'Calendar/UpcomingItemTemplate',
tagName : 'div', tagName : 'div',
events : { events: {
'click .x-episode-title' : '_showEpisodeDetails' 'click .x-episode-title': '_showEpisodeDetails'
}, },
_showEpisodeDetails : function() { _showEpisodeDetails: function () {
var view = new EpisodeLayout({ model: this.model }); App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: this.model});
App.modalRegion.show(view);
} }
}); });
}); });

@ -3,9 +3,8 @@
define( define(
[ [
'app', 'app',
'Cells/NzbDroneCell', 'Cells/NzbDroneCell'
'Episode/Layout' ], function (App, NzbDroneCell) {
], function (App, NzbDroneCell, EpisodeLayout) {
return NzbDroneCell.extend({ return NzbDroneCell.extend({
className: 'episode-title-cell', className: 'episode-title-cell',
@ -15,8 +14,7 @@ define(
}, },
showDetails: function () { showDetails: function () {
var view = new EpisodeLayout({ model: this.cellValue }); App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: this.cellValue});
App.modalRegion.show(view);
}, },
render: function () { render: function () {

@ -3,11 +3,10 @@ define(
[ [
'app', 'app',
'marionette', 'marionette',
'Series/Delete/DeleteSeriesView',
'Quality/QualityProfileCollection', 'Quality/QualityProfileCollection',
'Mixins/AsModelBoundView', 'Mixins/AsModelBoundView',
'Mixins/AutoComplete' 'Mixins/AutoComplete'
], function (App, Marionette, DeleteSeriesView, QualityProfiles, AsModelBoundView) { ], function (App, Marionette, QualityProfiles, AsModelBoundView) {
var view = Marionette.ItemView.extend({ var view = Marionette.ItemView.extend({
template: 'Series/Edit/EditSeriesTemplate', template: 'Series/Edit/EditSeriesTemplate',
@ -45,8 +44,7 @@ define(
}, },
_removeSeries: function () { _removeSeries: function () {
var view = new DeleteSeriesView({ model: this.model }); App.vent.trigger(App.Commands.DeleteSeriesCommand, {series:this.model});
App.modalRegion.show(view);
} }
}); });

@ -4,10 +4,7 @@ define(
[ [
'app', 'app',
'marionette', 'marionette',
'Series/Edit/EditSeriesView', ], function (App, Marionette) {
'Series/Delete/DeleteSeriesView'
], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
return Marionette.ItemView.extend({ return Marionette.ItemView.extend({
template: 'Series/Index/List/ItemTemplate', template: 'Series/Index/List/ItemTemplate',
@ -21,13 +18,11 @@ define(
}, },
editSeries: function () { editSeries: function () {
var view = new EditSeriesView({ model: this.model}); App.vent.trigger(App.Commands.EditSeriesCommand, {series: this.model});
App.modalRegion.show(view);
}, },
removeSeries: function () { removeSeries: function () {
var view = new DeleteSeriesView({ model: this.model }); App.vent.trigger(App.Commands.DeleteSeriesCommand, {series: this.model});
App.modalRegion.show(view);
} }
}); });
}); });

@ -3,11 +3,8 @@
define( define(
[ [
'app', 'app',
'marionette', 'marionette'
'Series/Edit/EditSeriesView', ], function (App, Marionette) {
'Series/Delete/DeleteSeriesView'
], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
return Marionette.ItemView.extend({ return Marionette.ItemView.extend({
tagName : 'li', tagName : 'li',
@ -28,13 +25,11 @@ define(
editSeries: function () { editSeries: function () {
var view = new EditSeriesView({ model: this.model}); App.vent.trigger(App.Commands.EditSeriesCommand, {series:this.model});
App.modalRegion.show(view);
}, },
removeSeries: function () { removeSeries: function () {
var view = new DeleteSeriesView({ model: this.model }); App.vent.trigger(App.Commands.DeleteSeriesCommand, {series:this.model});
App.modalRegion.show(view);
}, },
posterHoverAction: function () { posterHoverAction: function () {

@ -2,10 +2,8 @@
define( define(
[ [
'app', 'app',
'backgrid', 'backgrid'
'Series/Edit/EditSeriesView', ], function (App, Backgrid) {
'Series/Delete/DeleteSeriesView'
], function (App, Backgrid, EditSeriesView, DeleteSeriesView) {
return Backgrid.Row.extend({ return Backgrid.Row.extend({
events: { events: {
'click .x-edit' : 'editSeries', 'click .x-edit' : 'editSeries',
@ -13,14 +11,12 @@ define(
}, },
editSeries: function () { editSeries: function () {
var view = new EditSeriesView({ model: this.model}); App.vent.trigger(App.Commands.EditSeriesCommand, {series:this.model});
App.modalRegion.show(view);
}, },
removeSeries: function () { removeSeries: function () {
var view = new DeleteSeriesView({ model: this.model }); App.vent.trigger(App.Commands.DeleteSeriesCommand, {series:this.model});
App.modalRegion.show(view); },
}
}); });
}); });

@ -19,21 +19,21 @@ define(
}, },
_closeModal: function () { _closeModal: function () {
App.vent.trigger(App.Commands.CloseModalCommand); App.modalRegion.closeModal();
}, },
_editSeries: function (options) { _editSeries: function (options) {
var view = new EditSeriesView({ model: options.model }); var view = new EditSeriesView({ model: options.series });
App.modalRegion.show(view); App.modalRegion.show(view);
}, },
_deleteSeries: function (options) { _deleteSeries: function (options) {
var view = new DeleteSeriesView({ model: options.model }); var view = new DeleteSeriesView({ model: options.series });
App.modalRegion.show(view); App.modalRegion.show(view);
}, },
_showEpisode: function (options) { _showEpisode: function (options) {
var view = new EpisodeLayout({ model: options.model }); var view = new EpisodeLayout({ model: options.episode });
App.modalRegion.show(view); App.modalRegion.show(view);
} }
}); });

Loading…
Cancel
Save