Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
3a80a47a
I
incubator-echarts
项目概览
半栈学徒
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3a80a47a
编写于
6月 09, 2020
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(toolbox): fix icon emphasis status not keep when selected.
上级
eb94696f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
28 deletion
+38
-28
src/component/toolbox/ToolboxView.ts
src/component/toolbox/ToolboxView.ts
+36
-26
src/echarts.ts
src/echarts.ts
+2
-2
未找到文件。
src/component/toolbox/ToolboxView.ts
浏览文件 @
3a80a47a
...
@@ -143,8 +143,9 @@ class ToolboxView extends ComponentView {
...
@@ -143,8 +143,9 @@ class ToolboxView extends ComponentView {
const
iconPaths
=
this
.
iconPaths
;
const
iconPaths
=
this
.
iconPaths
;
option
.
iconStatus
=
option
.
iconStatus
||
{};
option
.
iconStatus
=
option
.
iconStatus
||
{};
option
.
iconStatus
[
iconName
]
=
status
;
option
.
iconStatus
[
iconName
]
=
status
;
// FIXME
if
(
iconPaths
[
iconName
])
{
iconPaths
[
iconName
]
&&
iconPaths
[
iconName
].
trigger
(
status
);
graphic
[
status
===
'
emphasis
'
?
'
enterEmphasis
'
:
'
leaveEmphasis
'
](
iconPaths
[
iconName
]);
}
};
};
if
(
feature
instanceof
ToolboxFeature
)
{
if
(
feature
instanceof
ToolboxFeature
)
{
...
@@ -240,31 +241,40 @@ class ToolboxView extends ComponentView {
...
@@ -240,31 +241,40 @@ class ToolboxView extends ComponentView {
},
tooltipModel
.
option
);
},
tooltipModel
.
option
);
}
}
graphic
.
enableHoverEmphasis
(
path
);
// graphic.enableHoverEmphasis(path);
if
(
toolboxModel
.
get
(
'
showTitle
'
))
{
(
path
as
ExtendedPath
).
__title
=
titlesMap
[
iconName
];
(
path
as
ExtendedPath
).
__title
=
titlesMap
[
iconName
];
(
path
as
graphic
.
Path
).
on
(
'
mouseover
'
,
function
()
{
(
path
as
graphic
.
Path
).
on
(
'
mouseover
'
,
function
()
{
// Should not reuse above hoverStyle, which might be modified.
// Should not reuse above hoverStyle, which might be modified.
const
hoverStyle
=
iconStyleEmphasisModel
.
getItemStyle
();
const
hoverStyle
=
iconStyleEmphasisModel
.
getItemStyle
();
const
defaultTextPosition
=
toolboxModel
.
get
(
'
orient
'
)
===
'
vertical
'
const
defaultTextPosition
=
toolboxModel
.
get
(
'
orient
'
)
===
'
vertical
'
?
(
toolboxModel
.
get
(
'
right
'
)
==
null
?
'
right
'
as
const
:
'
left
'
as
const
)
?
(
toolboxModel
.
get
(
'
right
'
)
==
null
?
'
right
'
as
const
:
'
left
'
as
const
)
:
(
toolboxModel
.
get
(
'
bottom
'
)
==
null
?
'
bottom
'
as
const
:
'
top
'
as
const
);
:
(
toolboxModel
.
get
(
'
bottom
'
)
==
null
?
'
bottom
'
as
const
:
'
top
'
as
const
);
textContent
.
setStyle
({
textContent
.
setStyle
({
fill
:
(
iconStyleEmphasisModel
.
get
(
'
textFill
'
)
fill
:
(
iconStyleEmphasisModel
.
get
(
'
textFill
'
)
||
hoverStyle
.
fill
||
hoverStyle
.
stroke
||
'
#000
'
)
as
string
,
||
hoverStyle
.
fill
||
hoverStyle
.
stroke
||
'
#000
'
)
as
string
,
backgroundColor
:
iconStyleEmphasisModel
.
get
(
'
textBackgroundColor
'
)
backgroundColor
:
iconStyleEmphasisModel
.
get
(
'
textBackgroundColor
'
)
});
path
.
setTextConfig
({
position
:
iconStyleEmphasisModel
.
get
(
'
textPosition
'
)
||
defaultTextPosition
});
textContent
.
ignore
=
false
;
})
.
on
(
'
mouseout
'
,
function
()
{
textContent
.
ignore
=
true
;
});
});
}
path
.
setTextConfig
({
path
.
trigger
(
featureModel
.
get
([
'
iconStatus
'
,
iconName
])
||
'
normal
'
);
position
:
iconStyleEmphasisModel
.
get
(
'
textPosition
'
)
||
defaultTextPosition
});
textContent
.
ignore
=
!
toolboxModel
.
get
(
'
showTitle
'
);
// Use enterEmphasis and leaveEmphasis provide by ec.
// There are flags managed by the echarts.
graphic
.
enterEmphasis
(
this
);
})
.
on
(
'
mouseout
'
,
function
()
{
if
(
featureModel
.
get
([
'
iconStatus
'
,
iconName
])
!==
'
emphasis
'
)
{
graphic
.
leaveEmphasis
(
this
);
}
textContent
.
hide
();
});
graphic
[
featureModel
.
get
([
'
iconStatus
'
,
iconName
])
===
'
emphasis
'
?
'
enterEmphasis
'
:
'
leaveEmphasis
'
](
path
);
group
.
add
(
path
);
group
.
add
(
path
);
(
path
as
graphic
.
Path
).
on
(
'
click
'
,
zrUtil
.
bind
(
(
path
as
graphic
.
Path
).
on
(
'
click
'
,
zrUtil
.
bind
(
...
...
src/echarts.ts
浏览文件 @
3a80a47a
...
@@ -1668,10 +1668,10 @@ class ECharts extends Eventful {
...
@@ -1668,10 +1668,10 @@ class ECharts extends Eventful {
):
void
{
):
void
{
each
(
dirtyList
||
ecIns
.
_componentsViews
,
function
(
componentView
:
ComponentView
)
{
each
(
dirtyList
||
ecIns
.
_componentsViews
,
function
(
componentView
:
ComponentView
)
{
const
componentModel
=
componentView
.
__model
;
const
componentModel
=
componentView
.
__model
;
componentView
.
render
(
componentModel
,
ecModel
,
api
,
payload
);
clearStates
(
componentModel
,
componentView
);
clearStates
(
componentModel
,
componentView
);
componentView
.
render
(
componentModel
,
ecModel
,
api
,
payload
);
updateZ
(
componentModel
,
componentView
);
updateZ
(
componentModel
,
componentView
);
updateHoverEmphasisHandler
(
componentView
);
updateHoverEmphasisHandler
(
componentView
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录