Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
7887f27a
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
7887f27a
编写于
4月 07, 2020
作者:
Y
Yi Shen
提交者:
GitHub
4月 07, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12380 from susiwen8/target
Fix potential security risk
上级
57dd7a3b
8cd07898
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
5 deletion
+24
-5
src/chart/sunburst/SunburstView.js
src/chart/sunburst/SunburstView.js
+2
-1
src/chart/treemap/TreemapView.js
src/chart/treemap/TreemapView.js
+2
-1
src/component/title.js
src/component/title.js
+3
-2
src/util/format.js
src/util/format.js
+17
-1
未找到文件。
src/chart/sunburst/SunburstView.js
浏览文件 @
7887f27a
...
...
@@ -21,6 +21,7 @@ import * as zrUtil from 'zrender/src/core/util';
import
ChartView
from
'
../../view/Chart
'
;
import
SunburstPiece
from
'
./SunburstPiece
'
;
import
DataDiffer
from
'
../../data/DataDiffer
'
;
import
{
windowOpen
}
from
'
../../util/format
'
;
var
ROOT_TO_NODE_ACTION
=
'
sunburstRootToNode
'
;
...
...
@@ -206,7 +207,7 @@ var SunburstView = ChartView.extend({
if
(
link
)
{
var
linkTarget
=
itemModel
.
get
(
'
target
'
,
true
)
||
'
_blank
'
;
window
.
o
pen
(
link
,
linkTarget
);
window
O
pen
(
link
,
linkTarget
);
}
}
targetFound
=
true
;
...
...
src/chart/treemap/TreemapView.js
浏览文件 @
7887f27a
...
...
@@ -28,6 +28,7 @@ import BoundingRect from 'zrender/src/core/BoundingRect';
import
*
as
matrix
from
'
zrender/src/core/matrix
'
;
import
*
as
animationUtil
from
'
../../util/animation
'
;
import
makeStyleMapper
from
'
../../model/mixin/makeStyleMapper
'
;
import
{
windowOpen
}
from
'
../../util/format
'
;
var
bind
=
zrUtil
.
bind
;
var
Group
=
graphic
.
Group
;
...
...
@@ -544,7 +545,7 @@ export default echarts.extendChartView({
var
itemModel
=
node
.
hostTree
.
data
.
getItemModel
(
node
.
dataIndex
);
var
link
=
itemModel
.
get
(
'
link
'
,
true
);
var
linkTarget
=
itemModel
.
get
(
'
target
'
,
true
)
||
'
blank
'
;
link
&&
window
.
o
pen
(
link
,
linkTarget
);
link
&&
window
O
pen
(
link
,
linkTarget
);
}
}
...
...
src/component/title.js
浏览文件 @
7887f27a
...
...
@@ -21,6 +21,7 @@ import * as zrUtil from 'zrender/src/core/util';
import
*
as
echarts
from
'
../echarts
'
;
import
*
as
graphic
from
'
../util/graphic
'
;
import
{
getLayoutRect
}
from
'
../util/layout
'
;
import
{
windowOpen
}
from
'
../util/format
'
;
// Model
echarts
.
extendComponentModel
({
...
...
@@ -143,12 +144,12 @@ echarts.extendComponentView({
if
(
link
)
{
textEl
.
on
(
'
click
'
,
function
()
{
window
.
o
pen
(
link
,
'
_
'
+
titleModel
.
get
(
'
target
'
));
window
O
pen
(
link
,
'
_
'
+
titleModel
.
get
(
'
target
'
));
});
}
if
(
sublink
)
{
subTextEl
.
on
(
'
click
'
,
function
()
{
window
.
open
(
sub
link
,
'
_
'
+
titleModel
.
get
(
'
subtarget
'
));
window
Open
(
link
,
'
_
'
+
titleModel
.
get
(
'
subtarget
'
));
});
}
...
...
src/util/format.js
浏览文件 @
7887f27a
...
...
@@ -23,7 +23,7 @@ import * as numberUtil from './number';
// import Text from 'zrender/src/graphic/Text';
/**
*
每三位默认加,格式化
*
add commas after every three numbers
* @param {string|number} x
* @return {string}
*/
...
...
@@ -275,3 +275,19 @@ export function getTextRect(
text
,
font
,
textAlign
,
textVerticalAlign
,
textPadding
,
textLineHeight
,
rich
,
truncate
);
}
/**
* open new tab
* @param {string} link url
* @param {string} target blank or self
*/
export
function
windowOpen
(
link
,
target
)
{
if
(
target
===
'
_blank
'
||
target
===
'
blank
'
)
{
var
blank
=
window
.
open
();
blank
.
opener
=
null
;
blank
.
location
=
link
;
}
else
{
window
.
open
(
link
,
target
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录