Skip to content

Commit

Permalink
Workaround for bug in clone() in jQuery 1.5 (see http://groups.google…
Browse files Browse the repository at this point in the history
  • Loading branch information
vitch committed Feb 4, 2011
1 parent 6a8973b commit 76f0071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions script/jquery.jscrollpane.js
Expand Up @@ -66,7 +66,7 @@
horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight,
reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousContentWidth,
wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false,
originalElement = elem.clone().empty(),
originalElement = elem.clone(false, false).empty(),
mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp';

originalPadding = elem.css('paddingTop') + ' ' +
Expand Down Expand Up @@ -153,7 +153,7 @@
// width as allowed by its container, regardless of overflow settings.
// A cunning workaround is to clone the element, set its position to absolute and place it in a narrow
// container. Now it will push outwards to its maxium real width...
clonedElem = pane.clone().css('position', 'absolute');
clonedElem = pane.clone(false, false).css('position', 'absolute');
tempWrapper = $('<div style="width:1px; position: relative;" />').append(clonedElem);
$('body').append(tempWrapper);
contentWidth = Math.max(pane.outerWidth(), clonedElem.outerWidth());
Expand Down

0 comments on commit 76f0071

Please sign in to comment.