Skip to content

Commit

Permalink
shows h scroll only if needed (mrdoob#28491)
Browse files Browse the repository at this point in the history
  • Loading branch information
ycw authored May 27, 2024
1 parent d40187b commit 55cc124
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 0 additions & 4 deletions editor/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ textarea, input { outline: none; } /* osx */
text-transform: uppercase;
}

.TabbedPanel .Tabs .Tab:last-child {
margin-right: 22px;
}

.TabbedPanel .Panels {
position: absolute;
top: 40px;
Expand Down
12 changes: 11 additions & 1 deletion editor/js/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ function Sidebar( editor ) {
const container = new UITabbedPanel();
container.setId( 'sidebar' );

const sidebarProperties = new SidebarProperties( editor );

const scene = new UISpan().add(
new SidebarScene( editor ),
new SidebarProperties( editor )
sidebarProperties
);
const project = new SidebarProject( editor );
const settings = new SidebarSettings( editor );
Expand All @@ -24,6 +26,14 @@ function Sidebar( editor ) {
container.addTab( 'settings', strings.getKey( 'sidebar/settings' ), settings );
container.select( 'scene' );

const sidebarPropertiesResizeObserver = new ResizeObserver( function () {

sidebarProperties.tabsDiv.setWidth( getComputedStyle( container.dom ).width );

} );

sidebarPropertiesResizeObserver.observe( container.tabsDiv.dom );

return container;

}
Expand Down

0 comments on commit 55cc124

Please sign in to comment.