From ed593dc3db83a084c8e4fa4dbcbdf3c144b82f79 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Wed, 12 Nov 2014 13:11:40 +0300 Subject: [PATCH 1/2] Added `max-height` option New `max-height` option, so a user could define the maximum height of slim-scroll instance. --- jquery.slimscroll.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/jquery.slimscroll.js b/jquery.slimscroll.js index 190368e..7c36ec8 100644 --- a/jquery.slimscroll.js +++ b/jquery.slimscroll.js @@ -1,8 +1,8 @@ -/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) +/*! Copyright (c) 2011-2014 Piotr Rochala (http://rocha.la) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * - * Version: 1.3.3 + * Version: 1.3.4 * */ (function($) { @@ -18,6 +18,9 @@ // height in pixels of the visible scroll area height : '250px', + // max-height in pixels of the visible scroll area + maxHeight: "none", + // width in pixels of the scrollbar and rail size : '7px', @@ -160,14 +163,16 @@ position: 'relative', overflow: 'hidden', width: o.width, - height: o.height + height: o.height, + "max-height": o.maxHeight }); // update style for the div me.css({ overflow: 'hidden', width: o.width, - height: o.height + height: o.height, + "max-height": o.maxHeight }); // create scrollbar rail From 5630a6e9bf586cdd1c195d47a398bd06f392b04b Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Wed, 12 Nov 2014 15:26:06 +0300 Subject: [PATCH 2/2] Added `max-height` option New `max-height` option, so a user could define the maximum height of slim-scroll instance. No reason to detect containers height in case it's set to auto. --- jquery.slimscroll.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.slimscroll.js b/jquery.slimscroll.js index 7c36ec8..fde4d1f 100644 --- a/jquery.slimscroll.js +++ b/jquery.slimscroll.js @@ -153,8 +153,8 @@ } } - // optionally set height to the parent's height - o.height = (o.height == 'auto') ? me.parent().height() : o.height; + // optionally set height to the parent's height in case height is not set to auto + o.height = (o.height == 'auto') ? 'auto' : o.height; // wrap content var wrapper = $(divS)