mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-16 07:01:03 +00:00
增加Inspector清理功能
This commit is contained in:
parent
915f144986
commit
7ae3b5466a
@ -82,6 +82,8 @@ export enum GA_EventName {
|
||||
GamePlayer = "game_player",
|
||||
GamePause = "game_pause",
|
||||
GameStep = "game_step",
|
||||
PickTop = "pick_top",
|
||||
InspectorClear = "inspector_clear",
|
||||
GameInspectorFilter = "game_inspector_filter",
|
||||
/**
|
||||
* 用户点击store广告链接
|
||||
|
@ -138,12 +138,21 @@ export default defineComponent({
|
||||
};
|
||||
});
|
||||
ccui.menu.showMenuByMouseEvent(event, [
|
||||
{
|
||||
name: "Clear",
|
||||
callback: (menu: IUiMenuItem) => {
|
||||
const event = new CustomEvent(DocumentEvent.InspectorClear);
|
||||
document.dispatchEvent(event);
|
||||
ga(GA_EventName.InspectorClear);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Pick Top",
|
||||
selected: config.value.pickTop,
|
||||
callback: (menu: IUiMenuItem) => {
|
||||
config.value.pickTop = !config.value.pickTop;
|
||||
appStore().save();
|
||||
ga(GA_EventName.PickTop);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -28,6 +28,10 @@ export class Hint {
|
||||
private inspector: Inspector = null;
|
||||
constructor(inspector: Inspector) {
|
||||
this.inspector = inspector;
|
||||
document.addEventListener(DocumentEvent.InspectorClear, () => {
|
||||
this.cleanHover();
|
||||
this.cleanSelected();
|
||||
});
|
||||
document.addEventListener(DocumentEvent.GameInspectorBegan, (event: CustomEvent) => {
|
||||
const el = this.getTargetElement();
|
||||
if (!el) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user