diff --git a/css/jquery.enhsplitter.css b/css/jquery.enhsplitter.css index fda967d..7932fe7 100644 --- a/css/jquery.enhsplitter.css +++ b/css/jquery.enhsplitter.css @@ -1,7 +1,7 @@ /*! * jQuery Enhanced Splitter Plugin * LESS / CSS File - * Version 1.2.1 + * Version 1.2.2 * * https://github.com/hiltonjanfield/jquery.enhsplitter * diff --git a/css/jquery.enhsplitter.less b/css/jquery.enhsplitter.less index 2e69b97..57ef682 100644 --- a/css/jquery.enhsplitter.less +++ b/css/jquery.enhsplitter.less @@ -1,7 +1,7 @@ /*! * jQuery Enhanced Splitter Plugin * LESS / CSS File - * Version 1.2.1 + * Version 1.2.2 * * https://github.com/hiltonjanfield/jquery.enhsplitter * diff --git a/js/jquery.enhsplitter.js b/js/jquery.enhsplitter.js index ef8f3fc..7b96cd8 100644 --- a/js/jquery.enhsplitter.js +++ b/js/jquery.enhsplitter.js @@ -1,7 +1,7 @@ /*! * jQuery Enhanced Splitter Plugin * Main ECMAScript File - * Version 1.2.1 + * Version 1.2.2 * * https://github.com/hiltonjanfield/jquery.enhsplitter * @@ -212,6 +212,11 @@ } else if (newPos >= self.containerSize - settings.rightMinSize - self.splitterSize) { newPos = self.containerSize - settings.rightMinSize - self.splitterSize; } + if (settings.leftMaxSize !== null && newPos >= settings.leftMaxSize) { + newPos = settings.leftMaxSize; + } else if (settings.rightMaxSize !== null && newPos <= self.containerSize - settings.rightMaxSize - self.splitterSize) { + newPos = self.containerSize - settings.rightMaxSize - self.splitterSize; + } self.currentPosition = newPos; if (self.settings.vertical) { diff --git a/test.html b/test.html index 251aad7..2f3b35e 100644 --- a/test.html +++ b/test.html @@ -135,12 +135,15 @@

jquery.enhsplitter Features Tests

); addTest( - {invisible: true}, - 'Invisible splitter. Splitter should still be fully functional (excluding the collapse handle).' + {invisible: true, leftMinSize: 10, leftMaxSize: 150}, + 'Invisible splitter. Splitter should still be fully functional (excluding the collapse handle).
' + + 'Left panel should be able to go from 10 to 150 pixels in size and no bigger.' ); addTest( { + leftMaxSize: 300, + rightMaxSize: 300, onDragStart: function (e, splitter) { bar = splitter.find('.splitter_bar'); bar.css('background', 'repeating-linear-gradient(60deg, silver, silver 5px, grey 5px, grey 10px)'); @@ -150,7 +153,8 @@

jquery.enhsplitter Features Tests

} }, 'Demonstration of onDragStart and onDragEnd events.
' + - 'Splitter should gain a striped background when being dragged.' + 'Splitter should gain a striped background when being dragged.
'+ + 'Tests an alternate form of size restriction by setting maximum sizes for each panel rather than minimums.' ); addTest(