This commit is contained in:
Vanessa 2023-09-13 12:07:17 +08:00
parent 268b928267
commit 143054075e
13 changed files with 7 additions and 15 deletions

View file

@ -1,7 +1,6 @@
import {hasClosestByClassName} from "../protyle/util/hasClosest";
import {Protyle} from "../protyle";
import {genUUID} from "../util/genID";
import {setPadding} from "../protyle/ui/initUI";
import {setPosition} from "../util/setPosition";
import {hideElements} from "../protyle/ui/hideElements";
import {Constants} from "../constants";

View file

@ -50,7 +50,6 @@ import {lockScreen} from "../../dialog/processSystem";
import {isWindow} from "../../util/functions";
import {reloadProtyle} from "../../protyle/util/reload";
import {fullscreen} from "../../protyle/breadcrumb/action";
import {setPadding} from "../../protyle/ui/initUI";
import {openRecentDocs} from "../../business/openRecentDocs";
import {App} from "../../index";
import {commandPanel} from "../../plugin/commandPanel";

View file

@ -2,7 +2,6 @@ import {getAllModels} from "../layout/getAll";
import {setInlineStyle} from "../util/assets";
import {fetchPost} from "../util/fetch";
import {confirmDialog} from "../dialog/confirmDialog";
import {setPadding} from "../protyle/ui/initUI";
import {reloadProtyle} from "../protyle/util/reload";
import {updateHotkeyTip} from "../protyle/util/compatibility";
import {Constants} from "../constants";

View file

@ -36,7 +36,7 @@ export const showTooltip = (message: string, target: Element, error = false) =>
if (target.getAttribute("data-position") === "right") {
left = targetRect.right - messageElement.clientWidth;
}
const bottomHeight = window.innerHeight - targetRect.bottom
const bottomHeight = window.innerHeight - targetRect.bottom;
messageElement.style.maxHeight = Math.max(targetRect.top, bottomHeight) + "px";
if (targetRect.top > bottomHeight) {
messageElement.style.top = (targetRect.top - messageElement.clientHeight) + "px";

View file

@ -8,7 +8,6 @@ import {getDisplayName, pathPosix} from "../util/pathName";
import {Constants} from "../constants";
import {setEditMode} from "../protyle/util/setEditMode";
import {Files} from "../layout/dock/Files";
import {setPadding} from "../protyle/ui/initUI";
import {fetchPost, fetchSyncPost} from "../util/fetch";
import {focusBlock, focusByRange} from "../protyle/util/selection";
import {onGet} from "../protyle/util/onGet";

View file

@ -6,7 +6,7 @@ import {getIconByType} from "../../editor/getIcon";
import {preventScroll} from "../../protyle/scroll/preventScroll";
import {openModel} from "./model";
import {getDisplayName, getNotebookIcon, getNotebookName, movePathTo, pathPosix} from "../../util/pathName";
import {getKeyByLiElement, initCriteriaMenu, moreMenu, queryMenu} from "../../search/menu";
import {getKeyByLiElement, initCriteriaMenu, moreMenu} from "../../search/menu";
import {setStorageVal} from "../../protyle/util/compatibility";
import {escapeGreat, escapeHtml} from "../../util/escape";
import {unicode2Emoji} from "../../emoji";

View file

@ -1,7 +1,7 @@
/// #if !MOBILE
import {getAllModels} from "../../layout/getAll";
/// #endif
import {addLoading, setPadding} from "../ui/initUI";
import {addLoading} from "../ui/initUI";
import {fetchPost} from "../../util/fetch";
import {Constants} from "../../constants";
import {hideAllElements, hideElements} from "../ui/hideElements";

View file

@ -13,7 +13,6 @@ import {needSubscribe} from "../../util/needSubscribe";
import {isMobile} from "../../util/functions";
import {zoomOut} from "../../menus/protyle";
import {getEditorRange} from "../util/selection";
import {setPadding} from "../ui/initUI";
/// #if !MOBILE
import {openFileById} from "../../editor/util";
import {setPanelFocus} from "../../layout/util";

View file

@ -2,7 +2,7 @@ import {Constants} from "../constants";
import {Hint} from "./hint";
import {setLute} from "./render/setLute";
import {Preview} from "./preview";
import {addLoading, initUI, removeLoading, setPadding} from "./ui/initUI";
import {addLoading, initUI, removeLoading} from "./ui/initUI";
import {Undo} from "./undo";
import {Upload} from "./upload";
import {Options} from "./util/Options";

View file

@ -1,5 +1,4 @@
import {setEditMode} from "../util/setEditMode";
import {lineNumberRender} from "../render/highlightRender";
import {scrollEvent} from "../scroll/event";
import {isMobile} from "../../util/functions";
import {Constants} from "../../constants";
@ -123,7 +122,7 @@ export const setPadding = (protyle: IProtyle) => {
padding: 0
};
}
const oldLeft = parseInt(protyle.wysiwyg.element.style.paddingLeft)
const oldLeft = parseInt(protyle.wysiwyg.element.style.paddingLeft);
let left = 16;
let right = 24;
if (!isMobile()) {
@ -172,7 +171,7 @@ export const setPadding = (protyle: IProtyle) => {
}
}
const oldWidth = protyle.wysiwyg.element.getAttribute("data-realwidth");
const newWidth = protyle.wysiwyg.element.clientWidth - parseInt(protyle.wysiwyg.element.style.paddingLeft) - parseInt(protyle.wysiwyg.element.style.paddingRight)
const newWidth = protyle.wysiwyg.element.clientWidth - parseInt(protyle.wysiwyg.element.style.paddingLeft) - parseInt(protyle.wysiwyg.element.style.paddingRight);
protyle.wysiwyg.element.setAttribute("data-realwidth", newWidth.toString());
return {
width: Math.abs(parseInt(oldWidth) - newWidth),

View file

@ -1,4 +1,3 @@
import {setPadding} from "../ui/initUI";
import {hideElements} from "../ui/hideElements";
import {getAllModels} from "../../layout/getAll";
import {updateOutline} from "../../editor/util";

View file

@ -18,7 +18,6 @@ import {hideElements} from "../ui/hideElements";
import {reloadProtyle} from "../util/reload";
import {countBlockWord} from "../../layout/status";
import {needLogin, needSubscribe} from "../../util/needSubscribe";
import {setPadding} from "../ui/initUI";
import {resize} from "../util/resize";
const removeTopElement = (updateElement: Element, protyle: IProtyle) => {

View file

@ -13,7 +13,7 @@ import {MenuItem} from "../menus/Menu";
import {getDisplayName, getNotebookIcon, getNotebookName, movePathTo, pathPosix} from "../util/pathName";
import {Protyle} from "../protyle";
import {onGet} from "../protyle/util/onGet";
import {addLoading, setPadding} from "../protyle/ui/initUI";
import {addLoading} from "../protyle/ui/initUI";
import {getIconByType} from "../editor/getIcon";
import {unicode2Emoji} from "../emoji";
import {hasClosestByClassName} from "../protyle/util/hasClosest";