-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(admin): prevent tinymce dialogs being disabled (V4-1201)
- event issue propagation between vuetify & tinymce dialogs - extract some common logic to composable
- Loading branch information
1 parent
b053119
commit 91ee3cb
Showing
5 changed files
with
41 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export { default as HtmlEditor } from './html-editor.vue'; | ||
export { default as JsonEditor } from './json-editor.vue'; | ||
export { default as JsonEditorDialog } from './json-editor-dialog.vue'; | ||
export * from './use-tinymce'; | ||
|
||
// export const JsonEditor = await import('./json-editor.vue'); | ||
// export const Tinymce = await import('./tinymce.vue'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { onBeforeMount, onBeforeUnmount } from 'vue'; | ||
|
||
export function useTinymce() { | ||
const focusInTox = (event: FocusEvent) => { | ||
const toxDialog = (event.target as HTMLElement).closest('.tox'); | ||
if (!toxDialog) | ||
return; | ||
|
||
event.stopImmediatePropagation(); | ||
}; | ||
|
||
onBeforeMount(() => { | ||
document.addEventListener('focusin', focusInTox, true); | ||
}); | ||
|
||
onBeforeUnmount(() => { | ||
document.removeEventListener('focusin', focusInTox, true); | ||
}); | ||
|
||
return { focusInTox }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters