File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import NavigationLayoutTemplate from "./NavigationLayoutTemplate.js";
1212// Styles
1313import NavigationLayoutCss from "./generated/themes/NavigationLayout.css.js" ;
1414
15+ const SCREEN_WIDTH_BREAKPOINT = 600 ;
16+
1517/**
1618 * @class
1719 *
@@ -49,7 +51,7 @@ import NavigationLayoutCss from "./generated/themes/NavigationLayout.css.js";
4951 template : NavigationLayoutTemplate ,
5052} )
5153class NavigationLayout extends UI5Element {
52- _defaultSideCollapsed = window . innerWidth < 600 ; // Small screens (599px or less)
54+ _defaultSideCollapsed = window . innerWidth < SCREEN_WIDTH_BREAKPOINT ;
5355
5456 /**
5557 * Specifies the navigation layout mode.
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import SideNavigationCss from "./generated/themes/SideNavigation.css.js";
3838import SideNavigationPopoverCss from "./generated/themes/SideNavigationPopover.css.js" ;
3939
4040const PAGE_UP_DOWN_SIZE = 10 ;
41+ const SCREEN_WIDTH_BREAKPOINT = 600 ;
4142
4243type SideNavigationPopoverContents = {
4344 item : SideNavigationItem ,
@@ -483,7 +484,7 @@ class SideNavigation extends UI5Element {
483484
484485 handleResize ( ) {
485486 // In smaller screen the side navigation hidden when collapsed and there is no overflow items
486- if ( window . innerWidth > 600 ) {
487+ if ( window . innerWidth > SCREEN_WIDTH_BREAKPOINT ) {
487488 this . _updateOverflowItems ( ) ;
488489 }
489490 }
Original file line number Diff line number Diff line change 44 */
55enum NavigationLayoutMode {
66 /**
7- * Automatically calculates the navigation layout mode based on the screen device type .
7+ * Automatically calculates the navigation layout mode based on the screen width .
88 * `Collapsed` on small screens (screen width of 599px or less) and `Expanded` on larger screens (screen width of 600px or more).
99 * @public
1010 */
You can’t perform that action at this time.
0 commit comments