1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-28 02:37:40 +00:00
Sonarr/UI/Shared/Modal/Region.js
kay.one 769331d45d updated jshint to 2.1.3
single quotes
2013-06-21 23:24:24 -07:00

44 lines
1.2 KiB
JavaScript

'use strict';
define(
[
'marionette',
'bootstrap'
], function (Marionette) {
return Marionette.Region.extend({
el: '#modal-region',
constructor: function () {
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 () {
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,
'backdrop': 'static'});
},
onClose: function(){
this.closeModal();
},
closeModal: function () {
this.$el.modal('hide');
}
});
});