File tree Expand file tree Collapse file tree 4 files changed +277
-11
lines changed Expand file tree Collapse file tree 4 files changed +277
-11
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,7 @@ class TooltipHTMLContent {
262
262
private _enterable = true ;
263
263
private _zr : ZRenderType ;
264
264
265
+ private _alwaysShowContent : boolean = false ;
265
266
private _hideTimeout : number ;
266
267
/**
267
268
* Hide delay time
@@ -360,6 +361,9 @@ class TooltipHTMLContent {
360
361
const alwaysShowContent = tooltipModel . get ( 'alwaysShowContent' ) ;
361
362
alwaysShowContent && this . _moveIfResized ( ) ;
362
363
364
+ // update alwaysShowContent
365
+ this . _alwaysShowContent = alwaysShowContent ;
366
+
363
367
// update className
364
368
this . el . className = tooltipModel . get ( 'className' ) || '' ;
365
369
@@ -488,7 +492,7 @@ class TooltipHTMLContent {
488
492
}
489
493
490
494
hideLater ( time ?: number ) {
491
- if ( this . _show && ! ( this . _inContent && this . _enterable ) ) {
495
+ if ( this . _show && ! ( this . _inContent && this . _enterable ) && ! this . _alwaysShowContent ) {
492
496
if ( time ) {
493
497
this . _hideDelay = time ;
494
498
// Set show false to avoid invoke hideLater multiple times
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ class TooltipRichContent {
37
37
38
38
private _hideTimeout : number ;
39
39
40
+ private _alwaysShowContent : boolean = false ;
41
+
40
42
private _enterable = true ;
41
43
42
44
private _inContent : boolean ;
@@ -56,6 +58,9 @@ class TooltipRichContent {
56
58
update ( tooltipModel : Model < TooltipOption > ) {
57
59
const alwaysShowContent = tooltipModel . get ( 'alwaysShowContent' ) ;
58
60
alwaysShowContent && this . _moveIfResized ( ) ;
61
+
62
+ // update alwaysShowContent
63
+ this . _alwaysShowContent = alwaysShowContent ;
59
64
}
60
65
61
66
show ( ) {
@@ -190,7 +195,7 @@ class TooltipRichContent {
190
195
}
191
196
192
197
hideLater ( time ?: number ) {
193
- if ( this . _show && ! ( this . _inContent && this . _enterable ) ) {
198
+ if ( this . _show && ! ( this . _inContent && this . _enterable ) && ! this . _alwaysShowContent ) {
194
199
if ( time ) {
195
200
this . _hideDelay = time ;
196
201
// Set show false to avoid invoke hideLater multiple times
Original file line number Diff line number Diff line change @@ -147,8 +147,6 @@ class TooltipView extends ComponentView {
147
147
148
148
private _api : ExtensionAPI ;
149
149
150
- private _alwaysShowContent : boolean ;
151
-
152
150
private _tooltipContent : TooltipHTMLContent | TooltipRichContent ;
153
151
154
152
private _refreshUpdateTimeout : number ;
@@ -196,12 +194,6 @@ class TooltipView extends ComponentView {
196
194
197
195
this . _api = api ;
198
196
199
- /**
200
- * @private
201
- * @type {boolean }
202
- */
203
- this . _alwaysShowContent = tooltipModel . get ( 'alwaysShowContent' ) ;
204
-
205
197
const tooltipContent = this . _tooltipContent ;
206
198
tooltipContent . update ( tooltipModel ) ;
207
199
tooltipContent . setEnterable ( tooltipModel . get ( 'enterable' ) ) ;
@@ -396,7 +388,7 @@ class TooltipView extends ComponentView {
396
388
) {
397
389
const tooltipContent = this . _tooltipContent ;
398
390
399
- if ( ! this . _alwaysShowContent && this . _tooltipModel ) {
391
+ if ( this . _tooltipModel ) {
400
392
tooltipContent . hideLater ( this . _tooltipModel . get ( 'hideDelay' ) ) ;
401
393
}
402
394
You can’t perform that action at this time.
0 commit comments