зеркало из https://github.com/mozilla/brackets.git
Fix https://github.com/mozilla/thimble.webmaker.org/issues/635 - proper resize code for sidebar on startup
This commit is contained in:
Родитель
8e204d52b6
Коммит
de5842fa7c
|
@ -92,7 +92,7 @@ define(function (require, exports, module) {
|
|||
|
||||
var sidebarWidth = BrambleStartupState.ui("sidebarWidth");
|
||||
if(sidebarWidth) {
|
||||
$("#sidebar").width(sidebarWidth);
|
||||
SidebarView.resize(sidebarWidth);
|
||||
}
|
||||
|
||||
var sidebarVisible = BrambleStartupState.ui("sidebarVisible");
|
||||
|
|
|
@ -104,6 +104,26 @@ define(function (require, exports, module) {
|
|||
Resizer.hide($sidebar);
|
||||
}
|
||||
|
||||
/**
|
||||
* XXXBramble: allow resizing programmatically
|
||||
*/
|
||||
function resize(width) {
|
||||
$sidebar.width(width);
|
||||
|
||||
ProjectManager._setFileTreeSelectionWidth(width);
|
||||
|
||||
var $element;
|
||||
$sidebar.find(".sidebar-selection").each(function (index, element) {
|
||||
$element = $(element);
|
||||
$element.width($element.parent()[0].scrollWidth);
|
||||
});
|
||||
|
||||
$sidebar.find(".sidebar-selection-extension").css("display", "block").css("left", width);
|
||||
$sidebar.find(".scroller-shadow").css("display", "block");
|
||||
$projectFilesContainer.triggerHandler("scroll");
|
||||
WorkingSetView.syncSelectionIndicator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the visibility state of the sidebar.
|
||||
* @return {boolean} true if element is visible, false if it is not visible
|
||||
|
@ -279,4 +299,5 @@ define(function (require, exports, module) {
|
|||
exports.show = show;
|
||||
exports.hide = hide;
|
||||
exports.isVisible = isVisible;
|
||||
exports.resize = resize;
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче