| 28919 | } |
| 28920 | |
| 28921 | function createExtensionAPI(ecInstance) { |
| 28922 | var coordSysMgr = ecInstance._coordSysMgr; |
| 28923 | return extend(new ExtensionAPI(ecInstance), { |
| 28924 | // Inject methods |
| 28925 | getCoordinateSystems: bind( |
| 28926 | coordSysMgr.getCoordinateSystems, coordSysMgr |
| 28927 | ), |
| 28928 | getComponentByElement: function (el) { |
| 28929 | while (el) { |
| 28930 | var modelInfo = el.__ecComponentInfo; |
| 28931 | if (modelInfo != null) { |
| 28932 | return ecInstance._model.getComponent(modelInfo.mainType, modelInfo.index); |
| 28933 | } |
| 28934 | el = el.parent; |
| 28935 | } |
| 28936 | } |
| 28937 | }); |
| 28938 | } |
| 28939 | |
| 28940 | |
| 28941 | /** |