From 3ec4ddc42dde146d0d12b567932cbfb2711ab49f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=83=D0=B1=D0=BE=D0=B2=D0=B8=D0=BA=20=D0=9C=D0=B0?= =?UTF-8?q?=D0=BA=D1=81=D0=B8=D0=BC?= Date: Wed, 13 Aug 2014 11:29:59 +0300 Subject: [PATCH 1/6] Bugfix maxHeight after $.colorbox.resize() Earlier, if I set .colorbox{maxHeight:'95%'...} then colorbox frame gets vertical scrollbar (if content is heighter than frame) but if then I do $.colorbox.resize() my colorbox frame becomes heighter than wrapper page and my maxHeight option is ignored, so this is bugfix for it. --- jquery.colorbox.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jquery.colorbox.js b/jquery.colorbox.js index 1e6c0d9..efcb725 100644 --- a/jquery.colorbox.js +++ b/jquery.colorbox.js @@ -733,6 +733,7 @@ scrolltop = $loaded.scrollTop(); $loaded.css({height: "auto"}); settings.h = $loaded.height(); + if (settings.h > settings.mh) settings.h=settings.mh; } $loaded.css({height: settings.h}); From 1e9c55a83c980b1dc0ce90f7e830ae0dba9dfd2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=83=D0=B1=D0=BE=D0=B2=D0=B8=D0=BA=20=D0=9C=D0=B0?= =?UTF-8?q?=D0=BA=D1=81=D0=B8=D0=BC?= Date: Wed, 13 Aug 2014 11:54:03 +0300 Subject: [PATCH 2/6] Simplifying code --- jquery.colorbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.colorbox.js b/jquery.colorbox.js index efcb725..3d3da79 100644 --- a/jquery.colorbox.js +++ b/jquery.colorbox.js @@ -733,7 +733,7 @@ scrolltop = $loaded.scrollTop(); $loaded.css({height: "auto"}); settings.h = $loaded.height(); - if (settings.h > settings.mh) settings.h=settings.mh; + settings.h = Math.min(settings.h, settings.mh); } $loaded.css({height: settings.h}); From 8922df5593412519bb7b5e93049481b1ccd8d292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=83=D0=B1=D0=BE=D0=B2=D0=B8=D0=BA=20=D0=9C=D0=B0?= =?UTF-8?q?=D0=BA=D1=81=D0=B8=D0=BC?= Date: Wed, 13 Aug 2014 12:02:15 +0300 Subject: [PATCH 3/6] Simplifying code --- jquery.colorbox.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jquery.colorbox.js b/jquery.colorbox.js index 3d3da79..c0ab377 100644 --- a/jquery.colorbox.js +++ b/jquery.colorbox.js @@ -732,8 +732,7 @@ if (!options.innerHeight && !options.height) { scrolltop = $loaded.scrollTop(); $loaded.css({height: "auto"}); - settings.h = $loaded.height(); - settings.h = Math.min(settings.h, settings.mh); + settings.h = Math.min($loaded.height(), settings.mh); } $loaded.css({height: settings.h}); From 219c8e400662f8fe674310e80d1fe255f02887bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=83=D0=B1=D0=BE=D0=B2=D0=B8=D0=BA=20=D0=9C=D0=B0?= =?UTF-8?q?=D0=BA=D1=81=D0=B8=D0=BC?= Date: Fri, 15 Aug 2014 19:50:18 +0300 Subject: [PATCH 4/6] Auto update absolute value of maxHeight on resize --- jquery.colorbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.colorbox.js b/jquery.colorbox.js index c0ab377..9342d35 100644 --- a/jquery.colorbox.js +++ b/jquery.colorbox.js @@ -732,7 +732,7 @@ if (!options.innerHeight && !options.height) { scrolltop = $loaded.scrollTop(); $loaded.css({height: "auto"}); - settings.h = Math.min($loaded.height(), settings.mh); + settings.h = Math.min(settings.h, setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight); } $loaded.css({height: settings.h}); From e8ae23defdc4162f1589126decce930f810cb4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=83=D0=B1=D0=BE=D0=B2=D0=B8=D0=BA=20=D0=9C=D0=B0?= =?UTF-8?q?=D0=BA=D1=81=D0=B8=D0=BC?= Date: Fri, 15 Aug 2014 19:51:35 +0300 Subject: [PATCH 5/6] Update jquery.colorbox.js --- jquery.colorbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.colorbox.js b/jquery.colorbox.js index 9342d35..092c5c6 100644 --- a/jquery.colorbox.js +++ b/jquery.colorbox.js @@ -732,7 +732,7 @@ if (!options.innerHeight && !options.height) { scrolltop = $loaded.scrollTop(); $loaded.css({height: "auto"}); - settings.h = Math.min(settings.h, setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight); + settings.h = Math.min($loaded.height(), setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight); } $loaded.css({height: settings.h}); From 9adc7d7ab65ff9bcb01de89a86cbbbc971311f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D1=83=D0=B1=D0=BE=D0=B2=D0=B8=D0=BA=20=D0=9C=D0=B0?= =?UTF-8?q?=D0=BA=D1=81=D0=B8=D0=BC?= Date: Thu, 21 Aug 2014 23:57:56 +0300 Subject: [PATCH 6/6] Bugfix if maxHeight is not set --- jquery.colorbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.colorbox.js b/jquery.colorbox.js index 092c5c6..19c8146 100644 --- a/jquery.colorbox.js +++ b/jquery.colorbox.js @@ -732,7 +732,7 @@ if (!options.innerHeight && !options.height) { scrolltop = $loaded.scrollTop(); $loaded.css({height: "auto"}); - settings.h = Math.min($loaded.height(), setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight); + settings.h = Math.min($loaded.height(), setSize(settings.get('maxHeight')||'100%', 'y') - loadedHeight - interfaceHeight); } $loaded.css({height: settings.h});