mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-29 11:46:09 +01:00
This commit is contained in:
parent
3d5c08e8b1
commit
dac23c88f6
1 changed files with 6 additions and 1 deletions
|
|
@ -383,13 +383,18 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
|
|||
cellRect = cellElements[0].getBoundingClientRect();
|
||||
let html = "";
|
||||
let height = cellRect.height;
|
||||
let style;
|
||||
if (contentElement) {
|
||||
const contentRect = contentElement.getBoundingClientRect();
|
||||
if (cellRect.bottom > contentRect.bottom) {
|
||||
height = contentRect.bottom - cellRect.top;
|
||||
}
|
||||
const width = Math.min(Math.max(cellRect.width, 25), contentRect.width)
|
||||
style = `style="padding-top: 6.5px;position:absolute;left: ${(cellRect.left < contentRect.left || cellRect.left + width > contentRect.right) ? contentRect.left : cellRect.left}px;top: ${cellRect.top}px;width:${width}px;height: ${height}px"`;
|
||||
} else {
|
||||
style = `style="padding-top: 6.5px;position:absolute;left: ${cellRect.left}px;top: ${cellRect.top}px;width:${Math.max(cellRect.width, 25)}px;height: ${height}px"`;
|
||||
}
|
||||
const style = `style="padding-top: 6.5px;position:absolute;left: ${cellRect.left}px;top: ${cellRect.top}px;width:${Math.max(cellRect.width, 25)}px;height: ${height}px"`;
|
||||
|
||||
if (["text", "email", "phone", "block", "template"].includes(type)) {
|
||||
html = `<textarea ${style} spellcheck="false" class="b3-text-field">${cellElements[0].firstElementChild.textContent}</textarea>`;
|
||||
} else if (type === "url") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue