-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(module:affix&anchor&back-top&avatar): add components to library #88
Conversation
e.preventDefault(); | ||
e.stopPropagation(); | ||
this._anchorComp.scrollTo(this); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest: no need to "return false"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good functionality with something can be improved, i'm going to improve these by another PR.
setTimeout(() => { | ||
this.handleScroll(); | ||
}, 500); | ||
this.scroll$ = Observable.fromEvent(this.getTarget(), 'scroll') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"fromEvent" will not available before you import it, so pls import { fromEvent } from 'rxjs/observables/fromEvent'
and then use this way to avoid polluting user's global Observable object: fromEvent(xxx, 'xxx')
. Why? see: https://github.com/angular/material2/blob/master/CODING_STANDARDS.md#rxjs
private registerScrollEvent() { | ||
this.removeListen(); | ||
this.handleScroll(); | ||
this.scroll$ = Observable.fromEvent(this.getTarget(), 'scroll') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should import fromEvent as mentioned above.
private registerScrollEvent() { | ||
this.removeListen(); | ||
this.reCalculate().process(); | ||
this.scroll$ = Observable.fromEvent(this.getTarget(), 'scroll') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should import fromEvent as mentioned below.
|
||
if (this.getTarget() !== window) { | ||
// 当 window 滚动位发生变动时,需要重新计算滚动容器 | ||
this.scrollWinInTarget$ = Observable.fromEvent(window, 'scroll') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should import fromEvent as mentioned below.
|
||
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove debug info.
it seems that you are use |
@LinboLen Have noticed, but CRLF is default in Windows. Any side effects is good to be heard. |
”树“控件计划什么时候引入进来 |
* master: refactor(module:dropdown): improve performance (NG-ZORRO#148) feat(module:tooltip,popconfirm,popover): support OnPush (NG-ZORRO#143) release(0.5.0-rc.3): pre-release 0.5.0-rc.3 (NG-ZORRO#166) fix(module:carousel): fix carousel auto play bug (NG-ZORRO#164) fix(module:input): fix input disabled style bug (NG-ZORRO#160) fix(module:input): fix input disabled style bug (NG-ZORRO#108) fix(module:affix,anchor,back-top): fix and improve rxjs usage (NG-ZORRO#159) feat(module:affix&anchor&back-top&avatar): add components to library (NG-ZORRO#88) fix(module:select): fix select reset bug in form (NG-ZORRO#153) fix(module:pagination) fix pagination double binding (NG-ZORRO#146) fix(module:select): fix option incorrect active status (NG-ZORRO#141) feat(module:root): make nz-root optional (NG-ZORRO#36)
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?