1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-28 02:27:13 +00:00
Lidarr/UI/Shared/ModalRegion.js

32 lines
740 B
JavaScript
Raw Normal View History

"use strict";
define('modal', function () {
var modal = Backbone.Marionette.Region.extend({
el: "#modal-region",
2013-02-10 03:42:44 +00:00
constructor: function () {
_.bindAll(this);
Backbone.Marionette.Region.prototype.constructor.apply(this, arguments);
this.on("show", this.showModal, this);
},
2013-02-10 03:42:44 +00:00
getEl: function (selector) {
var $el = $(selector);
$el.on("hidden", this.close);
return $el;
},
showModal: function (view) {
view.on("close", this.hideModal, this);
this.$el.modal('show');
},
hideModal: function () {
this.$el.modal('hide');
}
});
return modal;
});
2013-02-10 03:42:44 +00:00