🚨
This commit is contained in:
parent
f40ad7a8f1
commit
63eab3c5c1
3 changed files with 6 additions and 6 deletions
|
@ -70,8 +70,8 @@ export class Gutter {
|
|||
selectElements.forEach(item => {
|
||||
if (item.getAttribute("data-type") === "NodeIFrame") {
|
||||
const embedElement = genEmptyElement();
|
||||
embedElement.classList.add("protyle-wysiwyg--select")
|
||||
getContenteditableElement(embedElement).innerHTML = `<svg class="svg"><use xlink:href="#iconLanguage"></use></svg> IFrame`
|
||||
embedElement.classList.add("protyle-wysiwyg--select");
|
||||
getContenteditableElement(embedElement).innerHTML = "<svg class=\"svg\"><use xlink:href=\"#iconLanguage\"></use></svg> IFrame";
|
||||
ghostElement.append(embedElement);
|
||||
} else {
|
||||
ghostElement.append(item.cloneNode(true));
|
||||
|
|
|
@ -359,7 +359,7 @@ export const enableProtyle = (protyle: IProtyle) => {
|
|||
const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScrollAttr) => {
|
||||
let focusElement: Element;
|
||||
if (scrollAttr && scrollAttr.focusId) {
|
||||
focusElement = protyle.wysiwyg.element.querySelector(`[data-node-id="${scrollAttr.focusId}"]`)
|
||||
focusElement = protyle.wysiwyg.element.querySelector(`[data-node-id="${scrollAttr.focusId}"]`);
|
||||
} else {
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${protyle.block.id}"]`)).find((item: HTMLElement) => {
|
||||
if (!hasClosestByAttribute(item, "data-type", "block-render", true)) {
|
||||
|
@ -372,7 +372,7 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
|
|||
preventScroll(protyle);
|
||||
focusElement = protyle.wysiwyg.element.lastElementChild;
|
||||
} else if (!focusElement || action.includes(Constants.CB_GET_FOCUSFIRST)) {
|
||||
focusElement = protyle.wysiwyg.element.firstElementChild
|
||||
focusElement = protyle.wysiwyg.element.firstElementChild;
|
||||
}
|
||||
if (action.includes(Constants.CB_GET_HL)) {
|
||||
preventScroll(protyle); // 搜索页签滚动会导致再次请求
|
||||
|
@ -397,7 +397,7 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
|
|||
protyle.contentElement.scrollTop = scrollAttr.scrollTop;
|
||||
}
|
||||
// 加强定位
|
||||
protyle.observerLoad = new ResizeObserver((entries) => {
|
||||
protyle.observerLoad = new ResizeObserver(() => {
|
||||
if (action.includes(Constants.CB_GET_FOCUS) || action.includes(Constants.CB_GET_HL) || action.includes(Constants.CB_GET_FOCUSFIRST)) {
|
||||
focusElement.scrollIntoView();
|
||||
} else if (scrollAttr && scrollAttr.scrollTop) {
|
||||
|
|
|
@ -1052,7 +1052,7 @@ export class WYSIWYG {
|
|||
|
||||
private bindEvent(protyle: IProtyle) {
|
||||
// 删除块时,av 头尾需重新计算位置
|
||||
protyle.observer = new ResizeObserver((entries) => {
|
||||
protyle.observer = new ResizeObserver(() => {
|
||||
const contentRect = protyle.contentElement.getBoundingClientRect();
|
||||
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {
|
||||
if (item.querySelector(".av__title")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue