Skip to content

Commit a646729

Browse files
authored
Add a navigator fix width prop to DocumentationLayout (#822)
1 parent 1905cc6 commit a646729

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/components/DocumentationLayout.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ export default {
139139
type: Array,
140140
default: () => [],
141141
},
142+
navigatorFixedWidth: {
143+
type: Number,
144+
default: null,
145+
},
142146
},
143147
data() {
144148
return {
@@ -152,11 +156,14 @@ export default {
152156
enableQuickNavigation: ({ isTargetIDE }) => (
153157
!isTargetIDE && getSetting(['features', 'docs', 'quickNavigation', 'enable'], true)
154158
),
155-
sidebarProps: ({ sidenavVisibleOnMobile, enableNavigator, sidenavHiddenOnLarge }) => (
159+
sidebarProps: ({
160+
sidenavVisibleOnMobile, enableNavigator, sidenavHiddenOnLarge, navigatorFixedWidth,
161+
}) => (
156162
enableNavigator
157163
? {
158164
shownOnMobile: sidenavVisibleOnMobile,
159165
hiddenOnLarge: sidenavHiddenOnLarge,
166+
fixedWidth: navigatorFixedWidth,
160167
}
161168
: {
162169
enableNavigator,

tests/unit/components/DocumentationLayout.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const propsData = {
9292
objcPath: 'documentation/objc',
9393
swiftPath: 'documentation/swift',
9494
selectedAPIChangesVersion: '',
95+
navigatorFixedWidth: 400,
9596
};
9697

9798
const AdjustableSidebarWidthSmallStub = {
@@ -157,7 +158,7 @@ describe('DocumentationLayout', () => {
157158
shownOnMobile: false,
158159
hiddenOnLarge: false,
159160
enableNavigator: true,
160-
fixedWidth: null,
161+
fixedWidth: propsData.navigatorFixedWidth,
161162
});
162163
const {
163164
technology,

0 commit comments

Comments
 (0)