Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made uglify compatible #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/backbone.bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
* ok: The user clicked OK
*/
(function($, _, Backbone) {
'use strict';

//Set custom template settings
var _interpolateBackup = _.templateSettings;
_.templateSettings = {
interpolate: /\{\{(.+?)\}\}/g,
evaluate: /<%([\s\S]+?)%>/g
}
};

var template = _.template('\
<% if (title) { %>\
Expand Down Expand Up @@ -120,20 +121,21 @@
render: function() {
var $el = this.$el,
options = this.options,
content = options.content;
content = options.content,
$content;

//Create the modal container
$el.html(options.template(options));

var $content = this.$content = $el.find('.modal-body')
$content = this.$content = $el.find('.modal-body');

//Insert the main content if it's a view
if (content.$el) {
content.render();
$el.find('.modal-body').html(content.$el);
}

if (options.animate) $el.addClass('fade');
if (options.animate) { $el.addClass('fade'); }

this.isRendered = true;

Expand Down Expand Up @@ -268,7 +270,7 @@
if (typeof define === 'function' && define.amd) {
return define(function() {
Backbone.BootstrapModal = Modal;
})
});
}

//Regular; add to Backbone.Bootstrap.Modal
Expand Down