Skip to content

Commit

Permalink
feat(sunburst): nodeClick for level and data item setting
Browse files Browse the repository at this point in the history
fix and close #7541
  • Loading branch information
Ovilia committed Jan 23, 2018
1 parent cdc3594 commit c7d935b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/chart/sunburst/SunburstView.js
Expand Up @@ -164,23 +164,19 @@ var SunburstView = ChartView.extend({
var that = this;

var event = function (e) {
var nodeClick = that.seriesModel.get('nodeClick', true);
if (!nodeClick) {
return;
}

var targetFound = false;
var viewRoot = that.seriesModel.getViewRoot();
viewRoot.eachNode(function (node) {
if (!targetFound
&& node.piece && node.piece.childAt(0) === e.target
) {
var nodeClick = node.getModel().get('nodeClick');
if (nodeClick === 'rootToNode') {
that._rootToNode(node);
}
else if (nodeClick === 'link') {
var itemModel = node.getModel();
var link = itemModel.get('link', true);
var link = itemModel.get('link');

This comment has been minimized.

Copy link
@candy4290

candy4290 Jan 25, 2018

187行改成link && window.open(link, '_' + linkTarget); ?

This comment has been minimized.

Copy link
@Ovilia

Ovilia Jan 25, 2018

Author Contributor

linkTarget 是包含下划线的

if (link) {
var linkTarget = itemModel.get('target', true)
|| '_blank';
Expand Down

0 comments on commit c7d935b

Please sign in to comment.