Close WYSIWYG fullscreen when opening drawer or dialog (#12037)

This commit is contained in:
ian
2022-03-09 01:06:14 +08:00
committed by GitHub
parent 4c7cb46f2a
commit 079cf60425
4 changed files with 16 additions and 0 deletions

View File

@@ -36,6 +36,10 @@ export default function useImage(editor: Ref<any>, imageToken: Ref<string | unde
icon: 'image',
tooltip: i18n.global.t('wysiwyg_options.image'),
onAction: (buttonApi: any) => {
if (editor.value.plugins.fullscreen.isFullscreen()) {
editor.value.execCommand('mceFullScreen');
}
imageDrawerOpen.value = true;
if (buttonApi.isActive()) {

View File

@@ -37,6 +37,10 @@ export default function useLink(editor: Ref<any>): UsableLink {
icon: 'link',
tooltip: i18n.global.t('wysiwyg_options.link'),
onAction: (buttonApi: any) => {
if (editor.value.plugins.fullscreen.isFullscreen()) {
editor.value.execCommand('mceFullScreen');
}
linkDrawerOpen.value = true;
if (buttonApi.isActive()) {

View File

@@ -45,6 +45,10 @@ export default function useMedia(editor: Ref<any>, imageToken: Ref<string | unde
icon: 'embed',
tooltip: i18n.global.t('wysiwyg_options.media'),
onAction: (buttonApi: any) => {
if (editor.value.plugins.fullscreen.isFullscreen()) {
editor.value.execCommand('mceFullScreen');
}
mediaDrawerOpen.value = true;
if (buttonApi.isActive()) {

View File

@@ -23,6 +23,10 @@ export default function useSourceCode(editor: Ref<any>): UsableSourceCode {
icon: 'sourcecode',
tooltip: i18n.global.t('wysiwyg_options.source_code'),
onAction: () => {
if (editor.value.plugins.fullscreen.isFullscreen()) {
editor.value.execCommand('mceFullScreen');
}
codeDrawerOpen.value = true;
code.value = editor.value.getContent();
},