Merge branch 'evented-modals' into vnext

Conflicts:
	UI/Calendar/CalendarView.js
	UI/Series/Edit/EditSeriesView.js
	UI/Shared/Modal/Controller.js
pull/24/head
kay.one 12 years ago
commit 0548f49c44

@ -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 () {

@ -1,6 +1,6 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Delete: {{title}}</h3>
<h3>Delete {{title}}</h3>
</div>
<div class="modal-body delete-series-modal">

@ -1,11 +1,12 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Edit: {{title}}</h3>
<h3>{{title}}</h3>
</div>
<div class="modal-body edit-series-modal">
<div class="row">
<div class="span2">
<img class="series-poster" src="{{poster}}" {{defaultImg}}>
<img class="series-poster" src="{{poster}}"
{{defaultImg}}>
</div>
<div class="span7">
<div class="form-horizontal">
@ -76,17 +77,6 @@
</span>
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputCustomStartDate">Custom Start Date</label>
<div class="controls">
<input type="date" id="inputCustomStartDate" name="customStartDate">
<span class="help-inline">
<i class="icon-question-sign" title="Should NzbDrone only download episodes after your preferred start date?"/>
</span>
</div>
</div>
</div>
</div>
</div>

@ -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});
},
});
});

@ -6,7 +6,7 @@
overflow : visible;
.series-poster {
.card;
padding-left: 20px;
width : 168px;
}

@ -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