Skip to content

Commit 893b2cc

Browse files
committed
feat(category): show parent label in back pseudo-item
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent f24d4e0 commit 893b2cc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js/scripts.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ function updateCategoriesView() {
216216
slinkyCategories = $('#plugin_formcreator_wizard_categories div:nth(2)').slinky({
217217
label: true
218218
});
219+
220+
// Show label of parent in the 'back' item
221+
document.querySelectorAll('#plugin_formcreator_wizard_categories .slinky-menu a.back').forEach(item => {
222+
var parentLabel = item.closest('ul').closest('li').querySelector('a').innerText;
223+
item.innerText = parentLabel;
224+
});
225+
219226
$('#plugin_formcreator_wizard_categories a.back').on('click',
220227
function(event) {
221228
var parentItem = $(event.target).parentsUntil('#plugin_formcreator_wizard_categories .slinky-menu > ul', 'li')[1];

0 commit comments

Comments
 (0)