diff --git a/src/project/WorkingSetView.js b/src/project/WorkingSetView.js index b10ddc9cf37..67ad7d99a81 100644 --- a/src/project/WorkingSetView.js +++ b/src/project/WorkingSetView.js @@ -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. @@ -71,7 +85,7 @@ define(function (require, exports, module) { } else { $openFilesContainer.show(); } - + _adjustForScrollbars(); _fireSelectionChanged(); }