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

feat(module:affix&anchor&back-top&avatar): add components to library #88

Merged
merged 4 commits into from
Aug 26, 2017
Merged

Conversation

cipchk
Copy link
Member

@cipchk cipchk commented Aug 18, 2017

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 51.971% when pulling 5bb3738 on cipchk:master into b914afd on NG-ZORRO:master.

@cipchk cipchk changed the title add nz-affix & nz-anchor & nz-back-top & nz-avatar components feat(module:affix&anchor&back-top&avatar): add components to library Aug 18, 2017
e.preventDefault();
e.stopPropagation();
this._anchorComp.scrollTo(this);
return false;
Copy link
Member

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"

wilsoncook added a commit to wilsoncook/ng-zorro-antd that referenced this pull request Aug 26, 2017
Copy link
Member

@wilsoncook wilsoncook left a 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')
Copy link
Member

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')
Copy link
Member

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')
Copy link
Member

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')
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remove debug info.

@wilsoncook wilsoncook merged commit 468e80b into NG-ZORRO:master Aug 26, 2017
@LinboLen
Copy link
Contributor

it seems that you are use CRLF, please use LF Line Separator

@wilsoncook
Copy link
Member

@LinboLen Have noticed, but CRLF is default in Windows. Any side effects is good to be heard.

@mango-csl
Copy link

”树“控件计划什么时候引入进来

suraciii pushed a commit to suraciii/ng-zorro-antd that referenced this pull request Aug 30, 2017
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants