parent
7cf7b5e051
commit
27fc51da48
@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
define(['app'], function () {
|
||||
|
||||
NzbDrone.Episode.Layout = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Episode/Search/LayoutTemplate'
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
define(['app'], function () {
|
||||
|
||||
NzbDrone.Episode.Search.Layout = Backbone.Marionette.Layout.extend({
|
||||
template: 'Episode/Search/LayoutTemplate'
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
define(['app', 'Episode/Layout'], function () {
|
||||
NzbDrone.Series.Details.EpisodeDetailCell = Backgrid.Cell.extend({
|
||||
|
||||
events: {
|
||||
'click': 'showDetails'
|
||||
},
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
this.$el.html('<i class="icon-ellipsis-vertical x-detail-icon"/>');
|
||||
return this;
|
||||
},
|
||||
|
||||
showDetails: function () {
|
||||
var view = new NzbDrone.Episode.Layout({ model: this.model });
|
||||
NzbDrone.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
});
|
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
define(function () {
|
||||
|
||||
return Backbone.Marionette.Region.extend({
|
||||
el: "#modal-region",
|
||||
|
||||
constructor: function () {
|
||||
_.bindAll(this);
|
||||
Backbone.Marionette.Region.prototype.constructor.apply(this, arguments);
|
||||
this.on("show", this.showModal, this);
|
||||
},
|
||||
|
||||
getEl: function (selector) {
|
||||
var $el = $(selector);
|
||||
$el.on("hidden", this.close);
|
||||
return $el;
|
||||
},
|
||||
|
||||
showModal: function (view) {
|
||||
view.on("close", this.hideModal, this);
|
||||
this.$el.addClass('modal hide fade');
|
||||
|
||||
//need tab index so close on escape works
|
||||
//https://github.com/twitter/bootstrap/issues/4663
|
||||
this.$el.attr('tabindex','-1');
|
||||
this.$el.modal({'show': true, 'keyboard': true});
|
||||
},
|
||||
|
||||
hideModal: function () {
|
||||
this.$el.modal('hide');
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in new issue