You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/10/26 06:41:53 UTC
[incubator-echarts] branch next updated: chore: fix lint and tweak.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/next by this push:
new e9c8236 chore: fix lint and tweak.
e9c8236 is described below
commit e9c823603750ecaadb89423dc8dee58416333ece
Author: 100pah <su...@gmail.com>
AuthorDate: Mon Oct 26 14:41:18 2020 +0800
chore: fix lint and tweak.
---
src/component/tooltip/TooltipHTMLContent.ts | 4 ++--
src/component/tooltip/TooltipRichContent.ts | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/component/tooltip/TooltipHTMLContent.ts b/src/component/tooltip/TooltipHTMLContent.ts
index 6fbc396..ec750a3 100644
--- a/src/component/tooltip/TooltipHTMLContent.ts
+++ b/src/component/tooltip/TooltipHTMLContent.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { isString, indexOf, map, each, bind, isObject, isArray, isDom } from 'zrender/src/core/util';
+import { isString, indexOf, map, each, bind, isArray, isDom } from 'zrender/src/core/util';
import { toHex } from 'zrender/src/tool/color';
import { normalizeEvent } from 'zrender/src/core/event';
import { transformLocalCoord } from 'zrender/src/core/dom';
@@ -382,7 +382,7 @@ class TooltipHTMLContent {
content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);
}
if (isString(content)) {
- el.innerHTML = content == null ? '' : content;
+ el.innerHTML = content;
}
else if (content) {
// Clear previous
diff --git a/src/component/tooltip/TooltipRichContent.ts b/src/component/tooltip/TooltipRichContent.ts
index 1ac1436..053ed27 100644
--- a/src/component/tooltip/TooltipRichContent.ts
+++ b/src/component/tooltip/TooltipRichContent.ts
@@ -25,6 +25,7 @@ import { ZRColor } from '../../util/types';
import Model from '../../model/Model';
import ZRText, { TextStyleProps } from 'zrender/src/graphic/Text';
import { TooltipMarkupStyleCreator, getPaddingFromTooltipModel } from './tooltipMarkup';
+import { throwError } from '../../util/log';
class TooltipRichContent {
@@ -77,7 +78,7 @@ class TooltipRichContent {
arrowPosition: TooltipOption['position']
) {
if (zrUtil.isObject(content)) {
- throw new Error("Passing DOM nodes as content is not supported in richText tooltip!");
+ throwError(__DEV__ ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');
}
if (this.el) {
this._zr.remove(this.el);
@@ -86,7 +87,7 @@ class TooltipRichContent {
this.el = new ZRText({
style: {
rich: markupStyleCreator.richTextStyles,
- text: content,
+ text: content as string,
lineHeight: 22,
backgroundColor: tooltipModel.get('backgroundColor'),
borderRadius: tooltipModel.get('borderRadius'),
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org