From 525edb805cc2cd39e7d861fad2e5354d54a5344c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=89=B2?= Date: Thu, 21 Sep 2017 10:12:55 +0800 Subject: [PATCH] fix(module:anchor) remove history.pushState (#343) --- src/components/anchor/nz-anchor.component.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/anchor/nz-anchor.component.ts b/src/components/anchor/nz-anchor.component.ts index 0861509f2f1..dc829eb373c 100644 --- a/src/components/anchor/nz-anchor.component.ts +++ b/src/components/anchor/nz-anchor.component.ts @@ -12,7 +12,6 @@ import { Inject } from '@angular/core'; import { DOCUMENT } from '@angular/platform-browser'; -// import { Observable } from 'rxjs/Observable'; import { RxChain } from '@angular/cdk'; import { fromEvent } from 'rxjs/observable/fromEvent'; import { throttleTime } from 'rxjs/operator/throttleTime'; @@ -108,7 +107,6 @@ export class NzAnchorComponent { let linkNode = (maxSection.comp.el.nativeElement as HTMLDivElement).querySelector('.ant-anchor-link-title') as HTMLElement; this.ball.nativeElement.style.top = `${linkNode.offsetTop + linkNode.clientHeight / 2 - 4.5}px`; - // console.log(linkNode, linkNode.offsetTop + linkNode.clientHeight / 2 - 4.5); this.nzScroll.emit(maxSection.comp); } @@ -149,9 +147,6 @@ export class NzAnchorComponent { this.animating = false; this.handleScroll(); }); - - if (!location.href.includes('#')) - history.pushState(null, '', linkComp.nzHref); } ngOnDestroy(): void {