Skip to content

Commit 6795c26

Browse files
committed
fix[Tinymce]: custom-btn bug in fullscreen
1 parent 597df48 commit 6795c26

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/components/Tinymce/index.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="tinymce-container editor-container">
2+
<div class="tinymce-container editor-container" :class="{fullscreen:fullscreen}">
33
<textarea class="tinymce-textarea" :id="tinymceId"></textarea>
44
<div class="editor-custom-btn-container">
55
<editorImage color="#1890ff" class="editor-upload-btn" @successCBK="imageSuccessCBK"></editorImage>
@@ -43,7 +43,8 @@ export default {
4343
return {
4444
hasChange: false,
4545
hasInit: false,
46-
tinymceId: this.id || 'vue-tinymce-' + +new Date()
46+
tinymceId: this.id || 'vue-tinymce-' + +new Date(),
47+
fullscreen: false
4748
}
4849
},
4950
watch: {
@@ -91,6 +92,11 @@ export default {
9192
this.hasChange = true
9293
this.$emit('input', editor.getContent())
9394
})
95+
},
96+
setup(editor) {
97+
editor.on('FullscreenStateChanged', (e) => {
98+
_this.fullscreen = e.state
99+
})
94100
}
95101
// 整合七牛上传
96102
// images_dataimg_filter(img) {
@@ -168,6 +174,10 @@ export default {
168174
top: 4px;
169175
/*z-index: 2005;*/
170176
}
177+
.fullscreen .editor-custom-btn-container {
178+
z-index: 10000;
179+
position: fixed;
180+
}
171181
.editor-upload-btn {
172182
display: inline-block;
173183
}

src/components/Tinymce/toolbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Here is a list of the toolbar
22
// Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
33

4-
const toolbar = ['bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak fullscreen insertdatetime media table emoticons forecolor backcolor']
4+
const toolbar = ['bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen']
55

66
export default toolbar

0 commit comments

Comments
 (0)