Improve state management for rendering, sidebars, and mobile mode in pages.
Review Request #10739 — Created Oct. 2, 2019 and submitted
This updates
RB.PageView
to simplify some common operations that are
required by subclasses.An
isPageRendered
flag is now set after a page has been rendered.
Callbacks can use this to ensure that they're working with a page that
is now fully rendered to the DOM.The main sidebar content area is now accessible through a
$mainSidebar
attribute. This prevents pages from having to look up the correct
element themselves.Pages can now override
onMobileModeChanged()
to provide custom logic
when switching between desktop/mobile mode, instead of having to set up
a custom signal handler (which could easily and accidentally conflict
with the base page's_onMobileModeChanged
signal handler).
Made use of all these features in an upcoming change.
Unit tests pass.
Description | From | Last Updated |
---|---|---|
In your description, "A isPageRendered" -> "An isPageRendered" |
david |
- Description:
-
This updates
RB.PageView
to simplify some common operations that arerequired by subclasses. ~ A
isPageRendered
flag is now set after a page has been rendered.~ An
isPageRendered
flag is now set after a page has been rendered.Callbacks can use this to ensure that they're working with a page that is now fully rendered to the DOM. The main sidebar content area is now accessible through a
$mainSidebar
attribute. This prevents pages from having to look up the correct element themselves. Pages can now override
onMobileModeChanged()
to provide custom logicwhen switching between desktop/mobile mode, instead of having to set up a custom signal handler (which could easily and accidentally conflict with the base page's _onMobileModeChanged
signal handler).