1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import * as echarts from '../../core/echarts.js';
- import { noop } from 'zrender/lib/core/util.js';
- var ATTR = '\0_ec_interaction_mutex';
- export function take(zr, resourceKey, userKey) {
- var store = getStore(zr);
- store[resourceKey] = userKey;
- }
- export function release(zr, resourceKey, userKey) {
- var store = getStore(zr);
- var uKey = store[resourceKey];
- if (uKey === userKey) {
- store[resourceKey] = null;
- }
- }
- export function isTaken(zr, resourceKey) {
- return !!getStore(zr)[resourceKey];
- }
- function getStore(zr) {
- return zr[ATTR] || (zr[ATTR] = {});
- }
- echarts.registerAction({
- type: 'takeGlobalCursor',
- event: 'globalCursorTaken',
- update: 'update'
- }, noop);
|