Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[FIX] pane height does not care about original padding #165

Open
wants to merge 1 commit into from

2 participants

lexsimon asimon
lexsimon

Incorrect height calculation ignoring original padding and resulting in unnecessary scroll bars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 script/jquery.jscrollpane.js
6 script/jquery.jscrollpane.js
View
@@ -66,7 +66,7 @@
verticalDragPosition, horizontalDrag, dragMaxX, horizontalDragPosition,
verticalBar, verticalTrack, scrollbarWidth, verticalTrackHeight, verticalDragHeight, arrowUp, arrowDown,
horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight,
- reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousContentWidth,
+ reinitialiseInterval, originalPadding, originalPaddingTotalWidth, originalPaddingTotalHeight, previousContentWidth,
wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false,
originalElement = elem.clone(false, false).empty(),
mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp';
@@ -77,6 +77,8 @@
elem.css('paddingLeft');
originalPaddingTotalWidth = (parseInt(elem.css('paddingLeft'), 10) || 0) +
(parseInt(elem.css('paddingRight'), 10) || 0);
+ originalPaddingTotalHeight = (parseInt(elem.css('paddingTop'), 10) || 0) +
+ (parseInt(elem.css('paddingBottom'), 10) || 0);
function initialise(s)
{
@@ -100,7 +102,7 @@
// TODO: Deal with where width/ height is 0 as it probably means the element is hidden and we should
// come back to it later and check once it is unhidden...
paneWidth = elem.innerWidth() + originalPaddingTotalWidth;
- paneHeight = elem.innerHeight();
+ paneHeight = elem.innerHeight() + originalPaddingTotalHeight;
elem.width(paneWidth);
Something went wrong with that request. Please try again.