Fixed issues with edit/delete series modal.

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save