Set width of dialog main panel on relayout events
The files-ng layout moves the breadcrumbs and action bar to the right hand side of the splitter. When the length of the breadcrumbs and action bar combined exceed the width available, the content was being pushed to the right in LTR layout and to the left in RTL layout. Adds an event handler for the 'relayout' event that checks the widths of the main panel, navigation list, splitter and main panel and sets the width of the main panel explicitly if the main panel content is too wide to fit in the main window (which forces the browser to layout the child content of the main panel). Limiting the width of the main panel makes the content fit, and hence, scrolling of the content in the viewport can't happen. Note, the problem appears in 2 cases - one by expanding the directory tree with nested directories and narrow windows. Secondly, if the search box is expanded and space in the dialog header runs out, causing the header width to expand. For either case, if style width has not been set on the main panel, we force the setting the first time in, in order to stop clipping of expanded content. We throttle this rAF sizing as recommended for scroll events[1]. [1] https://developer.mozilla.org/en-US/docs/Web/API/Document/scroll_event Bug: 1059643 Change-Id: I545ed89113f5840f96dda8a94f3ec0ae51b1cc63 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2098140 Commit-Queue: Alex Danilo <adanilo@chromium.org> Reviewed-by:Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#749485}
Showing
Please register or sign in to comment