Vanessa 2022-05-28 19:40:42 +08:00
parent 6894c1690e
commit 60e3ae98cd
2 changed files with 9 additions and 1 deletions

View File

@ -112,6 +112,7 @@
&__bar { &__bar {
align-items: center; align-items: center;
flex-wrap: wrap;
display: flex; display: flex;
transition: var(--b3-transition); transition: var(--b3-transition);
margin-right: 8px; margin-right: 8px;
@ -126,6 +127,10 @@
transition: 1s; transition: 1s;
} }
&--nowrap {
flex-wrap: nowrap;
}
.b3-tooltips { .b3-tooltips {
height: 22px; height: 22px;
flex-shrink: 0; flex-shrink: 0;

View File

@ -391,6 +391,7 @@ export class Breadcrumb {
html += '<svg class="protyle-breadcrumb__arrow"><use xlink:href="#iconRight"></use></svg>'; html += '<svg class="protyle-breadcrumb__arrow"><use xlink:href="#iconRight"></use></svg>';
} }
}); });
this.element.classList.remove("protyle-breadcrumb__bar--nowrap");
this.element.innerHTML = html; this.element.innerHTML = html;
const itemElements = Array.from(this.element.querySelectorAll(".protyle-breadcrumb__text")); const itemElements = Array.from(this.element.querySelectorAll(".protyle-breadcrumb__text"));
if (itemElements.length === 0) { if (itemElements.length === 0) {
@ -404,7 +405,7 @@ export class Breadcrumb {
jump = true; jump = true;
return true; return true;
} }
if (index !== 0 && !item.classList.contains("protyle-breadcrumb__text--ellipsis")) { if (!item.classList.contains("protyle-breadcrumb__text--ellipsis")) {
item.classList.add("protyle-breadcrumb__text--ellipsis"); item.classList.add("protyle-breadcrumb__text--ellipsis");
return true; return true;
} }
@ -413,6 +414,8 @@ export class Breadcrumb {
} }
}); });
} }
this.element.classList.add("protyle-breadcrumb__bar--nowrap");
this.element.lastElementChild.previousElementSibling.scrollIntoView();
}); });
} }