[GitHub] [incubator-echarts] pissang commented on a change in pull request #13067: Optimize: disable tooltip transition at first show

2020-08-05 Thread GitBox


pissang commented on a change in pull request #13067:
URL: 
https://github.com/apache/incubator-echarts/pull/13067#discussion_r465523577



##
File path: src/component/tooltip/TooltipHTMLContent.ts
##
@@ -153,7 +151,7 @@ function assembleCssText(tooltipModel: 
Model) {
 cssText.push('box-shadow:' + boxShadow);
 // Animation transition. Do not animate when transitionDuration is 0.
 // If tooltip show arrow, then disable transition
-transitionDuration
+!isFirstShow && transitionDuration
 && !(['top', 'left', 'bottom', 
'right'].includes(tooltipModel.get('position') as string))
 && tooltipModel.get('trigger') !== 'item'

Review comment:
   Didn't notice it before. But we should use `zrUtil.indexOf` instead of 
`includes` here. 
   
   Also in the `assembleArrow` function also has `includes` usage. Which should 
be changed.





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org



[GitHub] [incubator-echarts] pissang commented on a change in pull request #13067: Optimize: disable tooltip transition at first show

2020-08-05 Thread GitBox


pissang commented on a change in pull request #13067:
URL: 
https://github.com/apache/incubator-echarts/pull/13067#discussion_r465497344



##
File path: src/component/tooltip/TooltipHTMLContent.ts
##
@@ -355,6 +354,7 @@ class TooltipHTMLContent {
 el.style.pointerEvents = this._enterable ? 'auto' : 'none';
 
 this._show = true;
+this._firstShow && (this._firstShow = false);

Review comment:
   I think this condition is not necessary. The expression can be simply
   ```js
   this._show = true;
   this._firstShow = false;
   ```





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org