Skip to content

Commit

Permalink
Remove $body from the object
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed Apr 30, 2015
1 parent efa7efd commit 28d507f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jquery.remodal.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,19 +403,19 @@
* @constructor
*/
function Remodal($modal, options) {
var $body = $(document.body);
var remodal = this;

remodal.settings = $.extend({}, DEFAULTS, options);
remodal.index = $[PLUGIN_NAME].lookup.push(remodal) - 1;
remodal.state = STATES.CLOSED;

// Build DOM
remodal.$body = $(document.body);
remodal.$overlay = $('.' + NAMESPACE + '-overlay');

if (!remodal.$overlay.length) {
remodal.$overlay = $('<div>').addClass(NAMESPACE + '-overlay');
remodal.$body.append(remodal.$overlay);
$body.append(remodal.$overlay);
}

remodal.$bg = $('.' + NAMESPACE + '-bg');
Expand All @@ -425,7 +425,7 @@
remodal.$modal.css('visibility', 'visible');

remodal.$wrapper.append(remodal.$modal);
remodal.$body.append(remodal.$wrapper);
$body.append(remodal.$wrapper);

// Add the close button event listener
remodal.$wrapper.on('click.' + NAMESPACE, '[data-' + NAMESPACE + '-action="close"]', function(e) {
Expand Down

0 comments on commit 28d507f

Please sign in to comment.