Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #745 from adobe/jason-sanjose/issue719
Browse files Browse the repository at this point in the history
Fix #719 (Unnecessary scroll bars in working set after closing file) -- Kick sidebarList layout to force new scroller height
  • Loading branch information
peterflynn committed Apr 26, 2012
2 parents 4c8a49f + 16cb246 commit fcf7e97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/ViewUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ define(function (require, exports, module) {
var $listItem = $listElement.find(selectedClassName).closest("li"),
isLeaf = $listItem.find("ul").length === 0;

// always hide selection visuals first to force layout (issue #719)
$selectionTriangle.hide();
$selectionMarker.hide();

if (($listItem.length === 1) && isLeaf) {
// list item position is relative to scroller
var selectionMarkerTop = $listItem.offset().top - $scrollerElement.offset().top + $scrollerElement.get(0).scrollTop;
Expand Down Expand Up @@ -217,10 +221,6 @@ define(function (require, exports, module) {
} else if (selectionMarkerBottom <= scrollerElement.scrollTop) {
scrollerElement.scrollTop = selectionMarkerTop;
}
} else {
// hide the selection marker when no selection is found
$selectionTriangle.hide();
$selectionMarker.hide();
}
};

Expand Down

0 comments on commit fcf7e97

Please sign in to comment.