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

Add class 'vertical-scroll' to the working set container when the scrollbar is present #1010

Merged
merged 2 commits into from
Jun 9, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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