cursorHelper.js 625 B

123456789101112131415161718
  1. var IRRELEVANT_EXCLUDES = {
  2. 'axisPointer': 1,
  3. 'tooltip': 1,
  4. 'brush': 1
  5. };
  6. /**
  7. * Avoid that: mouse click on a elements that is over geo or graph,
  8. * but roam is triggered.
  9. */
  10. function onIrrelevantElement(e, api, targetCoordSysModel) {
  11. var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.
  12. var coordSys = model && model.coordinateSystem;
  13. return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES[model.mainType] && coordSys && coordSys.model !== targetCoordSysModel;
  14. }
  15. exports.onIrrelevantElement = onIrrelevantElement;