You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/04/08 07:32:15 UTC
[GitHub] [echarts] Ovilia opened a new pull request #14620: fix(timeline): trigger timelineplaychange event when play to the end
Ovilia opened a new pull request #14620:
URL: https://github.com/apache/echarts/pull/14620
<!-- Please fill in the following information to help us review your PR more efficiently. -->
## Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
### What does this PR do?
<!-- USE ONCE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
`timelinePlayChanged` event is fired when timeline paused, so it should be fired when play to the end when not looping.
This PR makes it fires this event.
### Fixed issues
#14588
## Details
### Before: What was the problem?
<!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
<!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
When `loop` is `false` and timeline plays to the end, no event is fired.
### After: How is it fixed in this PR?
When `loop` is `false` and timeline plays to the end, `timelinePlayChanged` event is fired.
## Usage
### Are there any API changes?
- [ ] The API has been changed.
<!-- LIST THE API CHANGES HERE -->
### Related test cases or examples to use the new APIs
NA.
## Others
### Merging options
- [ ] Please squash the commits into a single one when merge.
### Other information
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] Ovilia commented on a change in pull request #14620: fix(timeline): trigger timelineplaychange event when play to the end
Posted by GitBox <gi...@apache.org>.
Ovilia commented on a change in pull request #14620:
URL: https://github.com/apache/echarts/pull/14620#discussion_r609399846
##########
File path: src/component/timeline/timelineAction.ts
##########
@@ -38,14 +39,25 @@ export function installTimelineAction(registers: EChartsExtensionInstallRegister
{type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate'},
- function (payload: TimelineChangePayload, ecModel: GlobalModel) {
+ function (payload: TimelineChangePayload, ecModel: GlobalModel, api: ExtensionAPI) {
const timelineModel = ecModel.getComponent('timeline') as TimelineModel;
if (timelineModel && payload.currentIndex != null) {
timelineModel.setCurrentIndex(payload.currentIndex);
- if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) {
+ if (
+ !timelineModel.get('loop', true)
+ && timelineModel.isIndexMax()
+ && timelineModel.getPlayState()
+ ) {
timelineModel.setPlayState(false);
+
+ // The timeline has played to the end, trigger event
+ api.dispatchAction({
+ type: 'timelinePlayChange',
+ playState: false,
+ from: payload.from
Review comment:
Should `from` be `payload.from` or `null`? The reason to use `null` is that play ending doesn't come directly from the view (button clicking).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] echarts-bot[bot] commented on pull request #14620: fix(timeline): trigger timelineplaychange event when play to the end
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #14620:
URL: https://github.com/apache/echarts/pull/14620#issuecomment-815525100
Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
The pull request is marked to be `PR: author is committer` because you are a committer of this project.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] echarts-bot[bot] commented on pull request #14620: fix(timeline): trigger timelineplaychange event when play to the end
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #14620:
URL: https://github.com/apache/echarts/pull/14620#issuecomment-871042586
Congratulations! Your PR has been merged. Thanks for your contribution! 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] Ovilia merged pull request #14620: fix(timeline): trigger timelineplaychange event when play to the end
Posted by GitBox <gi...@apache.org>.
Ovilia merged pull request #14620:
URL: https://github.com/apache/echarts/pull/14620
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] pissang commented on a change in pull request #14620: fix(timeline): trigger timelineplaychange event when play to the end
Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #14620:
URL: https://github.com/apache/echarts/pull/14620#discussion_r630934890
##########
File path: src/component/timeline/timelineAction.ts
##########
@@ -38,14 +39,25 @@ export function installTimelineAction(registers: EChartsExtensionInstallRegister
{type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate'},
- function (payload: TimelineChangePayload, ecModel: GlobalModel) {
+ function (payload: TimelineChangePayload, ecModel: GlobalModel, api: ExtensionAPI) {
const timelineModel = ecModel.getComponent('timeline') as TimelineModel;
if (timelineModel && payload.currentIndex != null) {
timelineModel.setCurrentIndex(payload.currentIndex);
- if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) {
+ if (
+ !timelineModel.get('loop', true)
+ && timelineModel.isIndexMax()
+ && timelineModel.getPlayState()
+ ) {
timelineModel.setPlayState(false);
+
+ // The timeline has played to the end, trigger event
+ api.dispatchAction({
+ type: 'timelinePlayChange',
+ playState: false,
+ from: payload.from
Review comment:
payload.from indicates the component fires this action. I think we can keep using `payload.from` here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org