From 8db90522c0820f0abc154a573689a0646bddc38f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C3=96zdemir?= Date: Mon, 6 May 2024 12:46:12 +0300 Subject: [PATCH] Update Breadcrumb.vue --- src/components/Breadcrumb.vue | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/components/Breadcrumb.vue b/src/components/Breadcrumb.vue index 86035090..94c8255d 100644 --- a/src/components/Breadcrumb.vue +++ b/src/components/Breadcrumb.vue @@ -102,23 +102,16 @@ app.emitter.on('vf-explorer-update', () => { let items = [], links = []; dirname.value = app.data.dirname ?? (app.adapter + '://'); - if (dirname.value.length == 0) { - breadcrumb.value = []; - } - dirname.value - .replace(app.adapter + '://', '') - .split('/') - .forEach(function (item) { - items.push(item); - if (items.join('/') != '') { - links.push({ - 'basename': item, - 'name': item, - 'path': app.adapter + '://' + items.join('/'), - 'type': 'dir' - }); - } - }); + app.fs.limitBreadcrumbItems(max_shown_items); + nextTick(() => { + console.log('width updated'); + for (let i = children.length-1; i >= 0; i--) { + if (totalWidth + children[i].offsetWidth > breadcrumbContainerWidth.value - 40) { + break; + } + totalWidth += parseInt(children[i].offsetWidth, 10); + count++; + } if (links.length > 4) { links = links.slice(-5);