Skip to content

Commit

Permalink
[修复] 修复最新tab在editable-box里面会报错,fixes #870
Browse files Browse the repository at this point in the history
  • Loading branch information
hpyou authored and rdkmaster committed Jan 14, 2019
1 parent 1475043 commit c171372
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit c171372

Please sign in to comment.