Skip to content

Commit

Permalink
setMagicType接口
Browse files Browse the repository at this point in the history
  • Loading branch information
kener committed Mar 13, 2014
1 parent 4c67572 commit b8e73cc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/component/toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ define(function (require) {
var _zlevelBase = self.getZlevelBase();
var _magicType;
var _magicMap;
var _isSilence = false;

var _iconList;
var _iconShapeMap = {};
var _itemGroupLocation;
Expand Down Expand Up @@ -774,6 +776,17 @@ define(function (require) {
);
return true;
}

function setMagicType(magicType) {
_resetMark();
_magicType = magicType;

!_isSilence && messageCenter.dispatch(
ecConfig.EVENT.MAGIC_TYPE_CHANGED,
null,
{magicType : _magicType}
);
}

// 重置备份还原状态等
function reset(newOption) {
Expand Down Expand Up @@ -916,6 +929,10 @@ define(function (require) {
return option;
}

function silence(s) {
_isSilence = s;
}

function render(newOption, newComponent){
_resetMark();
_resetZoom();
Expand Down Expand Up @@ -988,6 +1005,8 @@ define(function (require) {
self.resize = resize;
self.hideDataView = hideDataView;
self.getMagicOption = getMagicOption;
self.silence = silence;
self.setMagicType = setMagicType;
self.reset = reset;
self.refresh = refresh;
}
Expand Down

0 comments on commit b8e73cc

Please sign in to comment.