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 #1010 from jhatwich/jhatwich/verticalScrollClass
Browse files Browse the repository at this point in the history
Add class 'vertical-scroll' to the working set container when the scrollbar is present
  • Loading branch information
redmunds committed Jun 9, 2012
2 parents 747e44c + 9ce0b3d commit 8ffbe53
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/project/WorkingSetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ define(function (require, exports, module) {
$openFilesContainer.triggerHandler("contentChanged");
}

/**
* @private
* adds the style 'vertical-scroll' if a vertical scroll bar is present
*/
function _adjustForScrollbars() {
if ($openFilesContainer[0].scrollHeight > $openFilesContainer[0].clientHeight) {
if (!$openFilesContainer.hasClass("vertical-scroll")) {
$openFilesContainer.addClass("vertical-scroll");
}
} else {
$openFilesContainer.removeClass("vertical-scroll");
}
}

/**
* @private
* Shows/Hides open files list based on working set content.
Expand All @@ -71,7 +85,7 @@ define(function (require, exports, module) {
} else {
$openFilesContainer.show();
}

_adjustForScrollbars();
_fireSelectionChanged();
}

Expand Down

0 comments on commit 8ffbe53

Please sign in to comment.