Fix/wysiwyg context menu (#14404)

This commit is contained in:
ian
2022-07-13 00:32:35 +08:00
committed by GitHub
parent 5274ac577c
commit 7b32fbbd46
3 changed files with 23 additions and 1 deletions

View File

@@ -464,6 +464,24 @@ export default defineComponent({
});
setCount();
});
editor.on('OpenWindow', function (e: any) {
if (e.dialog?.getData) {
const data = e.dialog?.getData();
if (data) {
if (data.url) {
e.dialog.close();
editor.ui.registry.getAll().buttons.customlink.onAction();
}
if (data.src) {
e.dialog.close();
editor.ui.registry.getAll().buttons.customimage.onAction(true);
}
}
}
});
}
function setFocus(val: boolean) {

View File

@@ -273,6 +273,10 @@ body.dark .tox .tox-toolbar__overflow {
line-height: unset;
}
.tox .tox-collection__item-accessory {
color: var(--foreground-normal);
}
.tox .tox-textfield:focus,
.tox .tox-selectfield select:focus,
.tox .tox-textarea:focus {

View File

@@ -62,7 +62,7 @@ export default function useImage(
onAction: (buttonApi: any) => {
imageDrawerOpen.value = true;
if (buttonApi.isActive()) {
if (buttonApi === true || buttonApi.isActive()) {
const node = editor.value.selection.getNode() as HTMLImageElement;
const imageUrl = node.getAttribute('src');
const imageUrlParams = imageUrl ? new URL(imageUrl).searchParams : undefined;