🎨 Clean code
This commit is contained in:
parent
d26972d96a
commit
3b9cae1c03
4 changed files with 11 additions and 17 deletions
|
@ -30,7 +30,7 @@ export class Dock {
|
|||
public resizeElement: HTMLElement;
|
||||
public pin = true;
|
||||
public data: { [key: string]: Model | boolean };
|
||||
private hideResizeTimeout:number
|
||||
private hideResizeTimeout:number;
|
||||
|
||||
constructor(options: {
|
||||
app: App,
|
||||
|
|
|
@ -3,7 +3,7 @@ import {getInstanceById} from "../layout/util";
|
|||
import {Tab} from "../layout/Tab";
|
||||
import {initSearchMenu} from "./search";
|
||||
import {initDockMenu} from "./dock";
|
||||
import {initNavigationMenu, initFileMenu} from "./navigation";
|
||||
import {initFileMenu, initNavigationMenu} from "./navigation";
|
||||
import {initTabMenu} from "./tab";
|
||||
/// #endif
|
||||
import {Menu} from "./Menu";
|
||||
|
@ -74,7 +74,7 @@ export class Menus {
|
|||
}
|
||||
|
||||
if (hasClosestByClassName(target, "av__panel") && !hasClosestByClassName(target, "b3-menu")) {
|
||||
document.querySelector(".av__panel").dispatchEvent(new CustomEvent("click", {detail: "close"}))
|
||||
document.querySelector(".av__panel").dispatchEvent(new CustomEvent("click", {detail: "close"}));
|
||||
event.stopPropagation();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3,20 +3,14 @@ import {
|
|||
hasClosestByAttribute,
|
||||
hasClosestByClassName,
|
||||
hasClosestByMatchTag,
|
||||
hasClosestByTag, hasTopClosestByClassName
|
||||
hasClosestByTag,
|
||||
hasTopClosestByClassName
|
||||
} from "../util/hasClosest";
|
||||
import {getIconByType} from "../../editor/getIcon";
|
||||
import {enterBack, iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
|
||||
import {MenuItem} from "../../menus/Menu";
|
||||
import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
|
||||
import {
|
||||
copyPlainText,
|
||||
isMac,
|
||||
isOnlyMeta,
|
||||
openByMobile,
|
||||
updateHotkeyTip,
|
||||
writeText
|
||||
} from "../util/compatibility";
|
||||
import {copyPlainText, isMac, isOnlyMeta, openByMobile, updateHotkeyTip, writeText} from "../util/compatibility";
|
||||
import {
|
||||
transaction,
|
||||
turnsIntoOneTransaction,
|
||||
|
@ -842,7 +836,7 @@ export class Gutter {
|
|||
srcIDs: sourceIds,
|
||||
avID,
|
||||
}]);
|
||||
focusBlock(selectsElement[0])
|
||||
focusBlock(selectsElement[0]);
|
||||
});
|
||||
}
|
||||
}).element);
|
||||
|
@ -1303,7 +1297,7 @@ export class Gutter {
|
|||
srcIDs: sourceIds,
|
||||
avID,
|
||||
}]);
|
||||
focusBlock(nodeElement)
|
||||
focusBlock(nodeElement);
|
||||
});
|
||||
}
|
||||
}).element);
|
||||
|
|
|
@ -446,12 +446,12 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
|
|||
updateCellValueByInput(protyle, type, blockElement, cellElements);
|
||||
avMaskElement?.remove();
|
||||
}
|
||||
}
|
||||
};
|
||||
avMaskElement.addEventListener("click", (event) => {
|
||||
removeAvMask(event)
|
||||
removeAvMask(event);
|
||||
});
|
||||
avMaskElement.addEventListener("contextmenu", (event) => {
|
||||
removeAvMask(event)
|
||||
removeAvMask(event);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue