Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[修复] 修复最新tab在editable-box里面会报错,fixes #870 #871

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/jigsaw/component/tabs/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,13 @@ export class JigsawTab extends AbstractJigsawComponent implements AfterViewInit,
this._tabLabels.forEach((label: JigsawTabLabel, index) => {
let title = "";
let rootNodes = (<EmbeddedViewRef<any>>label._tabItemRef).rootNodes;
for (let i = 0; i < rootNodes.length; i++) {
if (rootNodes[i] instanceof HTMLElement) {
title += " " + rootNodes[i].outerHTML;
} else {
title += " " + rootNodes[i].textContent.trim();
if(rootNodes) {
for (let i = 0; i < rootNodes.length; i++) {
if (rootNodes[i] instanceof HTMLElement) {
title += " " + rootNodes[i].outerHTML;
} else {
title += " " + rootNodes[i].textContent.trim();
}
}
}
this._$tabList.push(title.trim());
Expand All @@ -624,6 +626,7 @@ export class JigsawTab extends AbstractJigsawComponent implements AfterViewInit,
private _tabsNav: ElementRef;

private _updateOverflowButton() {
if(!this._tabsNav || !this._tabsNavWrap) return;
this._$showOverflowButton = this._tabsNavWrap.nativeElement.offsetWidth < this._tabsNav.nativeElement.offsetWidth
}

Expand Down