Merge branch 'evented-modals' into vnext

Conflicts:
	UI/Calendar/CalendarView.js
	UI/Series/Edit/EditSeriesView.js
	UI/Shared/Modal/Controller.js
This commit is contained in:
kay.one 2013-07-23 21:20:04 -07:00
commit 0548f49c44
11 changed files with 34 additions and 65 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -1,11 +1,12 @@
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Edit: {{title}}</h3> <h3>{{title}}</h3>
</div> </div>
<div class="modal-body edit-series-modal"> <div class="modal-body edit-series-modal">
<div class="row"> <div class="row">
<div class="span2"> <div class="span2">
<img class="series-poster" src="{{poster}}" {{defaultImg}}> <img class="series-poster" src="{{poster}}"
{{defaultImg}}>
</div> </div>
<div class="span7"> <div class="span7">
<div class="form-horizontal"> <div class="form-horizontal">
@ -76,17 +77,6 @@
</span> </span>
</div> </div>
</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> </div>
</div> </div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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