Skip to content

Commit b35851b

Browse files
authored
[6.x] Use he-tree i18n prop for tree aria instructions (#14499)
1 parent ef5d3ff commit b35851b

File tree

5 files changed

+19
-25
lines changed

5 files changed

+19
-25
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dependencies": {
2222
"@davidenke/marked-text-renderer": "^3.0.0",
2323
"@floating-ui/dom": "^1.6.0",
24-
"@he-tree/vue": "^2.10.0-beta.2",
24+
"@he-tree/vue": "^2.10.5",
2525
"@hoppscotch/vue-toasted": "^0.1.0",
2626
"@inertiajs/vue3": "^2.1.11",
2727
"@internationalized/date": "^3.7.0",

resources/css/components/page-tree.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,3 @@
9393
@apply pt-1 rounded-t-2xl;
9494
}
9595
}
96-
97-
.he-tree-sr-only {
98-
@apply sr-only;
99-
}

resources/js/components/structures/PageTree.vue

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
:each-droppable="eachDroppable"
3232
:max-level="maxDepth"
3333
:stat-handler="statHandler"
34+
:i18n="treeDraggableI18n"
3435
:aria-label="__('Tree Structure')"
3536
@after-drop="afterDrop"
3637
@open:node="nodeOpened"
@@ -143,23 +144,19 @@ export default {
143144
direction() {
144145
return this.$config.get('direction', 'ltr');
145146
},
147+
148+
treeDraggableI18n() {
149+
return {
150+
instructions: __('messages.tree_aria_instructions'),
151+
};
152+
},
146153
},
147154
148155
watch: {
149156
site(site) {
150157
this.getPages();
151158
},
152159
153-
loading(loading) {
154-
if (!loading) {
155-
this.$nextTick(() => {
156-
if (this.$refs.tree) {
157-
this.$refs.tree.ariaInstructions = __('messages.tree_aria_instructions');
158-
}
159-
});
160-
}
161-
},
162-
163160
collapsedState: {
164161
deep: true,
165162
handler(state) {

resources/js/pages/preferences/nav/Edit.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
:indent="24"
8787
:dir="direction"
8888
:stat-handler="statHandler"
89+
:i18n="treeDraggableI18n"
8990
:aria-label="__('Tree Structure')"
9091
keep-placeholder
9192
trigger-class="page-move"
@@ -290,15 +291,15 @@ export default {
290291
mounted() {
291292
this.setInitialNav(this.nav);
292293
this.addToCommandPalette();
293-
294-
this.$nextTick(() => {
295-
if (this.$refs.tree) {
296-
this.$refs.tree.ariaInstructions = __('messages.tree_aria_instructions');
297-
}
298-
});
299294
},
300295
301296
computed: {
297+
treeDraggableI18n() {
298+
return {
299+
instructions: __('messages.tree_aria_instructions'),
300+
};
301+
},
302+
302303
isDirty() {
303304
return this.changed;
304305
},

0 commit comments

Comments
 (0)