mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 16:04:19 +01:00
This commit is contained in:
parent
ba0cf1cf28
commit
24e3c88c59
4 changed files with 4 additions and 9 deletions
|
|
@ -174,10 +174,7 @@ window.reconnectWebSocket = () => {
|
|||
window.goBack = goBack;
|
||||
window.showMessage = showMessage;
|
||||
window.processIOSPurchaseResponse = processIOSPurchaseResponse;
|
||||
window.showKeyboardToolbar = (height) => {
|
||||
document.getElementById("keyboardToolbar").setAttribute("data-keyboardheight", (height ? height : window.outerHeight / 2 - 42).toString());
|
||||
showKeyboardToolbar();
|
||||
};
|
||||
window.showKeyboardToolbar = showKeyboardToolbar;
|
||||
window.hideKeyboardToolbar = hideKeyboardToolbar;
|
||||
window.openFileByURL = (openURL) => {
|
||||
if (openURL && isSYProtocol(openURL)) {
|
||||
|
|
|
|||
|
|
@ -288,8 +288,7 @@ export const showKeyboardToolbarUtil = (oldScrollTop: number) => {
|
|||
showUtil = true;
|
||||
|
||||
const toolbarElement = document.getElementById("keyboardToolbar");
|
||||
let keyboardHeight = toolbarElement.getAttribute("data-keyboardheight");
|
||||
keyboardHeight = (keyboardHeight ? (parseInt(keyboardHeight) + 42) : window.outerHeight / 2) + "px";
|
||||
const keyboardHeight = document.documentElement.clientHeight - window.visualViewport.height + "px";
|
||||
const editor = getCurrentEditor();
|
||||
if (editor) {
|
||||
editor.protyle.element.parentElement.style.paddingBottom = keyboardHeight;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const popSide = (render = true) => {
|
|||
export const handleTouchEnd = (event: TouchEvent, app: App) => {
|
||||
const target = event.target as HTMLElement;
|
||||
const wysisygElement = hasClosestByClassName(target, "protyle-wysiwyg", true);
|
||||
if (!yDiff || Math.abs(yDiff) < 10) {
|
||||
if (!yDiff || Math.abs(yDiff) < 24) {
|
||||
let editElement: HTMLElement;
|
||||
if (["INPUT", "TEXTAREA"].includes(target.tagName) && target.getAttribute("readonly") !== "readonly") {
|
||||
editElement = target;
|
||||
|
|
|
|||
|
|
@ -417,8 +417,7 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme
|
|||
/// #if MOBILE
|
||||
const contentElement = hasClosestByClassName(blockElement, "protyle-content", true);
|
||||
if (contentElement && cellElement.getAttribute("data-dtype") !== "checkbox") {
|
||||
const keyboardToolbarElement = document.getElementById("keyboardToolbar");
|
||||
const keyboardH = parseInt(keyboardToolbarElement.getAttribute("data-keyboardheight")) || (window.outerHeight / 2 - 42);
|
||||
const keyboardH = document.documentElement.clientHeight - window.visualViewport.height;
|
||||
if (cellRect.bottom > window.innerHeight - keyboardH - 42) {
|
||||
contentElement.scrollTop += cellRect.bottom - window.innerHeight + 42 + keyboardH;
|
||||
} else if (cellRect.top < 110) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue