This commit is contained in:
parent
effaa31dce
commit
b8346b4649
2 changed files with 10 additions and 0 deletions
|
@ -357,6 +357,7 @@ export const openMenuPanel = (options: {
|
|||
avID,
|
||||
data: oldData,
|
||||
}]);
|
||||
const oldScroll = menuElement.querySelector(".b3-menu__items").scrollTop;
|
||||
if (options.cellElements) {
|
||||
menuElement.innerHTML = getSelectHTML(data.view, options.cellElements);
|
||||
bindSelectEvent(options.protyle, data, menuElement, options.cellElements, options.blockElement);
|
||||
|
@ -369,6 +370,7 @@ export const openMenuPanel = (options: {
|
|||
});
|
||||
bindEditEvent({protyle: options.protyle, data, menuElement, isCustomAttr, blockID});
|
||||
}
|
||||
menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll;
|
||||
return;
|
||||
}
|
||||
if (targetElement.getAttribute("data-type") === "setRelationCell") {
|
||||
|
|
|
@ -178,6 +178,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
|
|||
return true;
|
||||
}
|
||||
});
|
||||
const oldScroll = menuElement.querySelector(".b3-menu__items").scrollTop;
|
||||
if (!cellElements) {
|
||||
menuElement.innerHTML = getEditHTML({protyle, data, colId, isCustomAttr});
|
||||
bindEditEvent({protyle, data, menuElement, isCustomAttr, blockID});
|
||||
|
@ -203,6 +204,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
|
|||
menuElement.innerHTML = getSelectHTML(data.view, cellElements);
|
||||
bindSelectEvent(protyle, data, menuElement, cellElements, blockElement);
|
||||
}
|
||||
menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll;
|
||||
});
|
||||
if (menu.isOpen) {
|
||||
return;
|
||||
|
@ -251,6 +253,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
|
|||
return true;
|
||||
}
|
||||
});
|
||||
const oldScroll = menuElement.querySelector(".b3-menu__items").scrollTop;
|
||||
if (!cellElements) {
|
||||
menuElement.innerHTML = getEditHTML({protyle, data, colId, isCustomAttr});
|
||||
bindEditEvent({protyle, data, menuElement, isCustomAttr, blockID});
|
||||
|
@ -276,6 +279,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
|
|||
menuElement.innerHTML = getSelectHTML(data.view, cellElements);
|
||||
bindSelectEvent(protyle, data, menuElement, cellElements, blockElement);
|
||||
}
|
||||
menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -325,6 +329,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
|
|||
return true;
|
||||
}
|
||||
});
|
||||
const oldScroll = menuElement.querySelector(".b3-menu__items").scrollTop;
|
||||
if (!cellElements) {
|
||||
menuElement.innerHTML = getEditHTML({protyle, data, colId, isCustomAttr});
|
||||
bindEditEvent({protyle, data, menuElement, isCustomAttr, blockID});
|
||||
|
@ -351,6 +356,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
|
|||
menuElement.innerHTML = getSelectHTML(data.view, cellElements);
|
||||
bindSelectEvent(protyle, data, menuElement, cellElements, blockElement);
|
||||
}
|
||||
menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll;
|
||||
name = inputElement.value;
|
||||
color = (index + 1).toString();
|
||||
return true;
|
||||
|
@ -528,9 +534,11 @@ export const addColOptionOrCell = (protyle: IProtyle, data: IAV, cellElements: H
|
|||
if (colData.type === "select") {
|
||||
menuElement.parentElement.remove();
|
||||
} else {
|
||||
const oldScroll = menuElement.querySelector(".b3-menu__items").scrollTop;
|
||||
menuElement.innerHTML = getSelectHTML(data.view, cellElements);
|
||||
bindSelectEvent(protyle, data, menuElement, cellElements, blockElement);
|
||||
menuElement.querySelector("input").focus();
|
||||
menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue