diff --git a/src/model/Global.js b/src/model/Global.js index a3b621b5e75b7d7e3c18a8801ed5cd5b331541be..c6a4f8de72f25f5e68274db85fd2d557e7f79734 100644 --- a/src/model/Global.js +++ b/src/model/Global.js @@ -484,6 +484,7 @@ define(function (require) { * @inner */ function mappingToExists(existComponents, newComponentOptionList) { + existComponents = (existComponents || []).slice(); var result = []; // Mapping by id if specified. @@ -613,17 +614,16 @@ define(function (require) { /** * @inner */ - function determineSubType(componentType, newCptOption, existComponent) { + function determineSubType(mainType, newCptOption, existComponent) { var subType = newCptOption.type ? newCptOption.type : existComponent ? existComponent.subType - // Use determinSubType only when there is no existComponent. - : ComponentModel.determineSubType(componentType, newCptOption); + // Use determineSubType only when there is no existComponent. + : ComponentModel.determineSubType(mainType, newCptOption); - // FIXME - // tooltip, markline, markpoint may be no subType - return subType || '\0-'; + // tooltip, markline, markpoint may always has no subType + return subType; } /**