mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
refactor(editor): Convert Sticky component to Options API (no-changelog) (#10975)
This commit is contained in:
committed by
GitHub
parent
06d749ffa7
commit
b7951a071c
@@ -136,7 +136,7 @@ const htmlContent = computed(() => {
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
'markdown-click': [link: string, e: MouseEvent];
|
||||
'markdown-click': [link: HTMLAnchorElement, e: MouseEvent];
|
||||
'update-content': [content: string];
|
||||
}>();
|
||||
|
||||
@@ -154,7 +154,7 @@ const onClick = (event: MouseEvent) => {
|
||||
}
|
||||
}
|
||||
if (clickedLink) {
|
||||
emit('markdown-click', clickedLink?.href, event);
|
||||
emit('markdown-click', clickedLink, event);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ const emit = defineEmits<{
|
||||
resize: [values: ResizeData];
|
||||
resizestart: [];
|
||||
resizeend: [];
|
||||
'markdown-click': [link: HTMLAnchorElement, e: MouseEvent];
|
||||
}>();
|
||||
|
||||
const attrs = useAttrs();
|
||||
@@ -42,6 +43,10 @@ const onResizeEnd = () => {
|
||||
isResizing.value = false;
|
||||
emit('resizeend');
|
||||
};
|
||||
|
||||
const onMarkdownClick = (link: HTMLAnchorElement, event: MouseEvent) => {
|
||||
emit('markdown-click', link, event);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -57,6 +62,6 @@ const onResizeEnd = () => {
|
||||
@resize="onResize"
|
||||
@resizestart="onResizeStart"
|
||||
>
|
||||
<N8nSticky v-bind="stickyBindings" />
|
||||
<N8nSticky v-bind="stickyBindings" @markdown-click="onMarkdownClick" />
|
||||
</N8nResizeWrapper>
|
||||
</template>
|
||||
|
||||
@@ -13,7 +13,7 @@ const props = withDefaults(defineProps<StickyProps>(), defaultStickyProps);
|
||||
const emit = defineEmits<{
|
||||
edit: [editing: boolean];
|
||||
'update:modelValue': [value: string];
|
||||
'markdown-click': [link: string, e: Event];
|
||||
'markdown-click': [link: HTMLAnchorElement, e: MouseEvent];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
@@ -63,7 +63,7 @@ const onUpdateModelValue = (value: string) => {
|
||||
emit('update:modelValue', value);
|
||||
};
|
||||
|
||||
const onMarkdownClick = (link: string, event: Event) => {
|
||||
const onMarkdownClick = (link: HTMLAnchorElement, event: MouseEvent) => {
|
||||
emit('markdown-click', link, event);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user