提交 03c34608 编写于 作者: P pah100

Merge branch 'dev-3.0.0' of https://github.com/ecomfe/echarts into dev-3.0.0

......@@ -45,15 +45,6 @@ define(function (require) {
var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);
var feature;
featureModel.setIconStatus = function (iconName, status) {
var option = this.option;
var iconPaths = this.iconPaths;
option.iconStatus = option.iconStatus || {};
option.iconStatus[iconName] = status;
// FIXME
iconPaths[iconName] && iconPaths[iconName].trigger(status);
};
if (featureName && !oldName) { // Create
var Feature = featureManager.get(featureName);
if (!Feature) {
......@@ -63,6 +54,7 @@ define(function (require) {
}
else {
feature = features[oldName];
feature.model = featureModel;
}
if (!featureName && oldName) {
......@@ -76,6 +68,16 @@ define(function (require) {
}
createIconPaths(featureModel, feature, featureName);
featureModel.setIconStatus = function (iconName, status) {
var option = this.option;
var iconPaths = this.iconPaths;
option.iconStatus = option.iconStatus || {};
option.iconStatus[iconName] = status;
// FIXME
iconPaths[iconName] && iconPaths[iconName].trigger(status);
};
}
function createIconPaths(featureModel, feature, featureName) {
......@@ -110,10 +112,7 @@ define(function (require) {
var path = graphic.makePath(
icon, {
style: normalStyle,
hoverStyle: zrUtil.extend({
textPosition: 'bottom',
textFill: hoverStyle.fill || hoverStyle.stroke || '#000'
}, hoverStyle),
hoverStyle: hoverStyle,
rectHover: true
}, {
x: -itemSize / 2,
......@@ -127,10 +126,16 @@ define(function (require) {
if (toolboxModel.get('showTitle')) {
path.on('mouseover', function () {
path.setStyle('text', titles[iconName]);
path.setStyle({
textPosition: 'bottom',
text: titles[iconName],
textFill: hoverStyle.fill || hoverStyle.stroke || '#000'
});
})
.on('mouseout', function () {
path.setStyle('text', '');
path.setStyle({
textFill: null
});
});
}
path.trigger(featureModel.get('iconStatus.' + iconName) || 'normal');
......
......@@ -49,7 +49,6 @@ define(function (require) {
inside: false,
rotate: 0,
margin: 8,
// clickable: false,
// formatter: null,
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
textStyle: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册