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 1 commit
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
17 changes: 16 additions & 1 deletion src/project/WorkingSetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ define(function (require, exports, module) {
$openFilesContainer.triggerHandler("contentChanged");
}

/**
* @private
* adds the style 'vertical-scroll' if a vertical scroll bar is present
*/
function _adjustForScrollbars() {
var $container = $("#open-files-container");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use the existing $openFilesContainer (in place of $container) instead of doing this document search.

if ($container[0].scrollHeight > $container[0].clientHeight) {
if (!$container.hasClass("vertical-scroll")) {
$container.addClass("vertical-scroll");
}
} else {
$container.removeClass("vertical-scroll");
}
}

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

_adjustForScrollbars();
_fireSelectionChanged();
}

Expand Down