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:carousel): add enhancement API and methods #665

Closed
wants to merge 6 commits into from

Conversation

hsuanxyz
Copy link
Member

@hsuanxyz hsuanxyz commented Dec 2, 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:

What is the current behavior?

Issue Number: #652

What is the new behavior?

Added the following API & methods

API

参数 说明 类型 默认值
nzAutoPlaySpeed 自动切换速度, 单位毫秒 Number 3000
nzPauseOnHover 鼠标悬停暂停 Boolean true
nzAfterChange 切换面板后的回调, 参数为当前索引 Function(number)
nzBeforeChange 切换面板前的回调, 参数为当前的索引与被切换到的索引 Function({ form: number; to: number})

Methods

方法名 参数 说明 返回值值
nzSlickNext 切换到下一个面板
nzSlickPrev 切换到下一个面板
nzSlickGoTo index: number 切换到指定索引面板

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 41.623% when pulling 873495b on HsuanXyz:carousel into 9073bc8 on NG-ZORRO:master.

@vthinkxie
Copy link
Member

Hi @hsuanxyz , please rebase master and make all boolean @Input support attributes usage as https://github.com/NG-ZORRO/ng-zorro-antd/pull/459/files#diff-26c9eaa42ed9a7448f1a559c238529d3R68

@hsuanxyz
Copy link
Member Author

hsuanxyz commented Dec 5, 2017

@vthinkxie OK now.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 41.345% when pulling a453eb6 on HsuanXyz:carousel into 8ba3ea8 on NG-ZORRO:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 41.345% when pulling 3fd4752 on HsuanXyz:carousel into 8ba3ea8 on NG-ZORRO:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 40.991% when pulling 1f63b9c on HsuanXyz:carousel into 8665639 on NG-ZORRO:master.

@@ -88,9 +138,11 @@ export class NzCarouselComponent implements AfterViewInit, OnDestroy {
}

setActive(content, i) {
if (this.nzAutoPlay) {
if ((this.nzAutoPlay && !this.nzPauseOnHover) || (this.nzAutoPlay && !this._mouseHover)) {
Copy link
Member

Choose a reason for hiding this comment

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

should be

if ((this.nzAutoPlay && !this.nzPauseOnHover) || (this.nzAutoPlay && this.nzPauseOnHover && !this._mouseHover)){
}

@vthinkxie
Copy link
Member

@hsuanxyz

@hsuanxyz
Copy link
Member Author

hsuanxyz commented Dec 6, 2017

@vthinkxie Sorry I botch up the git log, new PR #688

@hsuanxyz hsuanxyz deleted the carousel branch May 2, 2018 03:59
@hsuanxyz hsuanxyz restored the carousel branch May 2, 2018 03:59
@hsuanxyz hsuanxyz deleted the carousel branch May 2, 2018 04:00
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.

5 participants