Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyapps committed Jul 8, 2013
1 parent 2089374 commit 4e1c57f
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 78 deletions.
4 changes: 2 additions & 2 deletions demo/ajax.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div style="max-width:700px;">
<div style="max-width:700px;min-width:200px;">
<h2>Lorem ipsum dolor sit amet3</h2>
<p>
<a href="javascript:jQuery.fancybox.close();">Close me</a>
Expand All @@ -10,6 +10,6 @@
Phasellus et ligula vel diam ullamcorper volutpat. Integer rhoncus rhoncus aliquam. Aliquam erat volutpat. Aenean luctus vestibulum placerat. Quisque quam neque, lacinia aliquet eleifend ac, aliquet blandit felis. Curabitur porta ultricies dui, sit amet mattis quam euismod a. Ut eleifend scelerisque neque, sit amet accumsan odio consequat ut. Proin facilisis auctor elit sed accumsan. Cras dapibus nisl in nisi rhoncus laoreet. Nullam pellentesque tortor libero, eget facilisis ipsum. Donec ultricies tellus tellus, in tincidunt purus. Nullam in est aliquam velit scelerisque blandit. In tincidunt, magna a dapibus imperdiet, quam urna elementum leo, vitae rhoncus nisl velit cursus velit. In dignissim sem ac mauris rhoncus ornare.
</p>
<p>
Duis imperdiet velit vel quam malesuada suscipit imperdiet tellus hendrerit. Mauris vestibulum odio mauris, ut placerat leo. Mauris quis neque at tellus feugiat congue id non enim. Nam vehicula posuere nulla eget vehicula. Donec pretium purus nec ligula porta eu laoreet sapien venenatis. Nulla facilisi. Phasellus eget mi enim. Phasellus molestie tincidunt ultrices. Aenean id sem a tellus lobortis tincidunt. Nam laoreet nulla vel velit tincidunt ac rutrum libero malesuada. Nulla consequat dolor quis nisl tempor fermentum. Integer sodales pretium varius. Aenean a leo vitae odio dictum dignissim malesuada nec dolor. Phasellus adipiscing viverra est, ac sagittis libero sagittis quis. Sed interdum dapibus nunc et fringilla. Nunc vel velit et urna laoreet bibendum.
Duis imperdiet velit vel quam malesuada suscipit imperdiet tellus hendrerit. Mauris vestibulum odio mauris, ut placerat leo. Mauris quis neque at tellus feugiat congue id non enim. Nam vehicula posuere nulla eget vehicula. Donec pretium purus nec ligula porta eu laoreet sapien venenatis. Nulla facilisi. Phasellus eget mi enim. Phasellus molestie tincidunt ultrices. Aenean id sem a tellus lobortis tincidunt. Nam laoreet nulla vel velit tincidunt ac rutrum libero malesuada. Nulla consequat dolor quis nisl tempor fermentum. Integer sodales pretium varius. Aenean a leo vitae odio dictum dignissim malesuada nec dolor. Phasellus adipiscing viverra est, ac sagittis libero sagittis quis. Sed interdum dapibus nunc et fringilla. Nunc vel velit et urna laoreet bibendum.
</p>
</div>
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- Add jQuery library -->
<script type="text/javascript" src="../lib/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="../lib/jquery-1.10.2.min.js"></script>

<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="../lib/jquery.mousewheel-3.0.6.pack.js"></script>
Expand Down
31 changes: 31 additions & 0 deletions fancybox.jquery.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "fancybox",
"title": "fancyBox",
"description": "fancyBox offers an elegant way to present images, html content and multimedia for webpages",
"keywords": [
"lightbox",
"effect",
"responsive",
"modal",
"window",
"ui"
],
"version": "2.1.5",
"author": {
"name": "Janis Skarnelis",
"url": "http://fancyapps.com/contact/"
},
"licenses": [
{
"type": "fancyBox",
"url": "http://fancyapps.com/fancybox/#license"
}
],
"homepage": "http://fancyapps.com/fancybox/",
"docs": "http://fancyapps.com/fancybox/#docs",
"download": "http://fancyapps.com/fancybox/#license",
"bugs": "https://github.com/fancyapps/fancyBox/issues",
"dependencies": {
"jquery": ">=1.7"
}
}
6 changes: 0 additions & 6 deletions lib/jquery-1.10.1.min.js

This file was deleted.

6 changes: 6 additions & 0 deletions lib/jquery-1.10.2.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion source/helpers/jquery.fancybox-buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* });
*
*/
(function ($) {
;(function ($) {
//Shortcut for fancyBox object
var F = $.fancybox;

Expand Down
2 changes: 1 addition & 1 deletion source/helpers/jquery.fancybox-media.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
*/
(function ($) {
;(function ($) {
"use strict";

//Shortcut for fancyBox object
Expand Down
2 changes: 1 addition & 1 deletion source/helpers/jquery.fancybox-thumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* });
*
*/
(function ($) {
;(function ($) {
//Shortcut for fancyBox object
var F = $.fancybox;

Expand Down
40 changes: 16 additions & 24 deletions source/jquery.fancybox.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
*/

(function (window, document, $, undefined) {
;(function (window, document, $, undefined) {
"use strict";

var H = $("html"),
Expand Down Expand Up @@ -639,7 +639,7 @@
y: W.scrollTop()
};

if (locked) {
if (locked && locked.length) {
rez.w = locked[0].clientWidth;
rez.h = locked[0].clientHeight;

Expand Down Expand Up @@ -1117,7 +1117,7 @@
break;

case 'image':
content = current.tpl.image.replace('{href}', href);
content = current.tpl.image.replace(/\{href\}/g, href);
break;

case 'swf':
Expand Down Expand Up @@ -1703,13 +1703,17 @@

// Public methods
create : function(opts) {
var parent;

opts = $.extend({}, this.defaults, opts);

if (this.overlay) {
this.close();
}

this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( F.coming ? F.coming.parent : opts.parent );
parent = F.coming ? F.coming.parent : opts.parent;

this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( parent && parent.lenth ? parent : 'body' );
this.fixed = false;

if (opts.fixed && F.defaults.fixed) {
Expand Down Expand Up @@ -1755,19 +1759,14 @@
},

close : function() {
var scrollV, scrollH;

W.unbind('resize.overlay');

if (this.el.hasClass('fancybox-lock')) {
$('.fancybox-margin').removeClass('fancybox-margin');

scrollV = W.scrollTop();
scrollH = W.scrollLeft();

this.el.removeClass('fancybox-lock');

W.scrollTop( scrollV ).scrollLeft( scrollH );
W.scrollTop( this.scrollV ).scrollLeft( this.scrollH );
}

$('.fancybox-overlay').remove().hide();
Expand Down Expand Up @@ -1812,10 +1811,6 @@
}

if (opts.locked && this.fixed && obj.fixed) {
if (!overlay) {
this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
}

obj.locked = this.overlay.append( obj.wrap );
obj.fixed = false;
}
Expand All @@ -1826,23 +1821,21 @@
},

beforeShow : function(opts, obj) {
var scrollV, scrollH;

if (obj.locked) {
if (this.margin !== false) {
if (obj.locked && !this.el.hasClass('fancybox-lock')) {
if (this.fixPosition !== false) {
$('*').filter(function(){
return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
}).addClass('fancybox-margin');

this.el.addClass('fancybox-margin');
}

scrollV = W.scrollTop();
scrollH = W.scrollLeft();
this.el.addClass('fancybox-margin');

this.scrollV = W.scrollTop();
this.scrollH = W.scrollLeft();

this.el.addClass('fancybox-lock');

W.scrollTop( scrollV ).scrollLeft( scrollH );
W.scrollTop( this.scrollV ).scrollLeft( this.scrollH );
}

this.open(opts);
Expand All @@ -1857,7 +1850,6 @@
afterClose: function (opts) {
// Remove overlay if exists and fancyBox is not opening
// (e.g., it is not being open using afterClose callback)
//if (this.overlay && !F.isActive) {
if (this.overlay && !F.coming) {
this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
}
Expand Down
Loading

0 comments on commit 4e1c57f

Please sign in to comment.