Skip to content

Commit

Permalink
New option 'parent' to specify content parent element; default value …
Browse files Browse the repository at this point in the history
…is ; usefult for ASP.NET users
  • Loading branch information
fancyapps committed Jun 12, 2012
1 parent 5a1b79f commit 31e5215
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 29 deletions.
22 changes: 12 additions & 10 deletions source/jquery.fancybox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* fancyBox - jQuery Plugin
* version: 2.0.6 (Tue, 22 May 2012)
* version: 2.0.6 (Tue, 12 Jun 2012)
* @requires jQuery v1.6 or later
*
* Examples at http://fancyapps.com/fancybox/
Expand Down Expand Up @@ -837,7 +837,7 @@
}

// Build the neccessary markup
coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo('body');
coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent );

$.extend(coming, {
skin : $('.fancybox-skin', coming.wrap).css('padding', getValue(coming.padding)),
Expand Down Expand Up @@ -937,7 +937,7 @@

_loadIframe: function() {
var coming = F.coming,
iframe = $(coming.tpl.iframe.replace('{rnd}', new Date().getTime()))
iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
.attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
.attr('src', coming.href);

Expand Down Expand Up @@ -1045,8 +1045,8 @@
} else if (isQuery(content)) {
content = content.show().detach();

$(current.wrap).bind('onReset', function () {
$(this).find('.fancybox-inner').children().appendTo('body').hide();
current.wrap.bind('onReset', function () {
$(this).find('.fancybox-inner').children().appendTo( current.parent ).hide();
});
}
break;
Expand Down Expand Up @@ -1705,7 +1705,7 @@
if (!selector || options.live === false) {
that.unbind('click.fb-start').bind('click.fb-start', run);
} else {
D.undelegate(selector, 'click.fb-start').delegate(selector, 'click.fb-start', run);
D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
}

return this;
Expand All @@ -1726,9 +1726,11 @@

// Tests that need a body at doc ready
D.ready(function() {
F.defaults.scrollOutside = $.scrollbarWidth();

F.defaults.fixed = $.support.fixedPosition || !(($.browser.msie && $.browser.version <= 6) || isTouch);
$.extend(F.defaults, {
scrollOutside : $.scrollbarWidth(),
fixed : $.support.fixedPosition || !(($.browser.msie && $.browser.version <= 6) || isTouch),
parent : $('body')
});
});

}(window, document, jQuery));
}(window, document, jQuery));
Loading

0 comments on commit 31e5215

Please sign in to comment.