2013-02-16 01:49:25 +01:00
|
|
|
|
define(['app'], function () {
|
|
|
|
|
return Backbone.Marionette.Region.extend({
|
2013-02-14 03:28:56 +01:00
|
|
|
|
el: "#modal-region",
|
2013-02-10 04:42:44 +01:00
|
|
|
|
|
2013-02-14 03:28:56 +01:00
|
|
|
|
constructor: function () {
|
|
|
|
|
_.bindAll(this);
|
|
|
|
|
Backbone.Marionette.Region.prototype.constructor.apply(this, arguments);
|
|
|
|
|
this.on("show", this.showModal, this);
|
|
|
|
|
},
|
2013-02-10 04:42:44 +01:00
|
|
|
|
|
2013-02-14 03:28:56 +01: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');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2013-02-10 04:42:44 +01:00
|
|
|
|
|
|
|
|
|
|