Skip to content

Commit e81a9d0

Browse files
hqhhuangmportiz08
andauthored
Allow customization for QuickNavigation (#913)
Resolves: rdar://139682470 Co-authored-by: Marcus Ortiz <[email protected]>
1 parent 6990af9 commit e81a9d0

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/components/DocumentationLayout.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
<div class="documentation-layout-aside">
3434
<QuickNavigationModal
3535
v-if="enableQuickNavigation"
36-
:children="indexNodes"
36+
:children="quickNavNodes || indexNodes"
3737
:showQuickNavigationModal.sync="showQuickNavigationModal"
3838
:technology="technology ? technology.title : ''"
39+
:placeholder="quickNavPlaceholder"
3940
/>
4041
<transition name="delay-hiding">
4142
<slot
@@ -134,7 +135,7 @@ export default {
134135
},
135136
technology: {
136137
type: Object,
137-
require: false,
138+
required: false,
138139
},
139140
parentTopicIdentifiers: {
140141
type: Array,
@@ -144,6 +145,14 @@ export default {
144145
type: Number,
145146
default: null,
146147
},
148+
quickNavNodes: {
149+
type: Array,
150+
default: null,
151+
},
152+
quickNavPlaceholder: {
153+
type: String,
154+
default: null,
155+
},
147156
},
148157
data() {
149158
return {

src/components/Navigator/QuickNavigationModal.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ export default {
195195
type: String,
196196
required: false,
197197
},
198+
placeholder: {
199+
type: String,
200+
required: false,
201+
},
198202
},
199203
computed: {
200204
childrenMap({ children }) {
@@ -224,6 +228,7 @@ export default {
224228
return orderSymbolsByPriority(uniqueMatches).slice(0, MAX_RESULTS);
225229
},
226230
placeholderText() {
231+
if (this.placeholder) return this.placeholder;
227232
if (!this.technology) return this.$t('filter.search');
228233
return this.$t('filter.search-symbols', { technology: this.technology });
229234
},

src/lang/locales/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"filter": {
134134
"title": "Filter",
135135
"search": "Search",
136-
"search-symbols": "Search symbols in {technology}",
136+
"search-symbols": "Search for symbols in {technology}",
137137
"suggested-tags": "Suggested tag | Suggested tags",
138138
"selected-tags": "Selected tag | Selected tags",
139139
"add-tag": "Add tag",

0 commit comments

Comments
 (0)