mirror of
https://github.com/haiwen/seahub.git
synced 2025-10-22 03:16:34 +00:00
feat: optimize code
This commit is contained in:
@@ -51,4 +51,3 @@
|
||||
.sf-metadata-radio-group .sf-metadata-radio-group-option.active + .sf-metadata-radio-group-option::before {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
|
@@ -98,4 +98,3 @@ export const PASTE_SOURCE = {
|
||||
COPY: 'copy',
|
||||
CUT: 'cut',
|
||||
};
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @fileoverview MarkerClusterer标记聚合器用来解决加载大量点要素到地图上产生覆盖现象的问题,并提高性能。
|
||||
* @fileoverview MarkerCluster标记聚合器用来解决加载大量点要素到地图上产生覆盖现象的问题,并提高性能。
|
||||
* 主入口类是<a href="symbols/BMapLib.MarkerCluster.html">MarkerCluster</a>,
|
||||
* 基于Baidu Map API 1.2。
|
||||
*
|
||||
@@ -583,14 +583,14 @@ var BMapLib = window.BMapLib = BMapLib || {};
|
||||
let clickTimeout;
|
||||
this._clusterMarker.addEventListener("click", (event) => {
|
||||
if (clickTimeout) {
|
||||
clearTimeout(clickTimeout);
|
||||
clickTimeout = null;
|
||||
return;
|
||||
clearTimeout(clickTimeout);
|
||||
clickTimeout = null;
|
||||
return;
|
||||
}
|
||||
clickTimeout = setTimeout(() => {
|
||||
if (this._markerClusterer && typeof this._markerClusterer.getCallback() === 'function') {
|
||||
const markers = this._markers;
|
||||
this._markerClusterer.getCallback()(event, markers);
|
||||
if (this._markerClusterer && typeof this._markerClusterer.getCallback() === 'function') {
|
||||
const markers = this._markers;
|
||||
this._markerClusterer.getCallback()(event, markers);
|
||||
}
|
||||
clickTimeout = null;
|
||||
}, 300); // Delay to differentiate between single and double click
|
||||
@@ -598,8 +598,8 @@ var BMapLib = window.BMapLib = BMapLib || {};
|
||||
|
||||
this._clusterMarker.addEventListener("dblclick", (event) => {
|
||||
if (clickTimeout) {
|
||||
clearTimeout(clickTimeout);
|
||||
clickTimeout = null;
|
||||
clearTimeout(clickTimeout);
|
||||
clickTimeout = null;
|
||||
}
|
||||
// Do nothing on double click
|
||||
});
|
||||
|
Reference in New Issue
Block a user