File tree 3 files changed +30
-3
lines changed
3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 3
3
:text =" t('base.fontFamily.text')"
4
4
menu-type =" select"
5
5
hide-text
6
- :select-value =" editor?.getAttributes('textStyle').fontFamily || null"
6
+ :select-value ="
7
+ isTypeRunning
8
+ ? null
9
+ : editor?.getAttributes('textStyle').fontFamily || null
10
+ "
7
11
:style =" { width: $toolbar.mode !== 'classic' ? '144px' : '90px' }"
8
12
filterable
9
13
@menu-click =" setFontFamily"
@@ -44,6 +48,14 @@ const options = inject('options')
44
48
const $toolbar = useState (' toolbar' , options )
45
49
const $recent = useState (' recent' , options )
46
50
51
+ import { getTypewriterRunState } from ' @/extensions/type-writer'
52
+ let isTypeRunning = $ref (false )
53
+ watch (
54
+ () => getTypewriterRunState (),
55
+ (newValue : boolean ) => {
56
+ isTypeRunning = newValue
57
+ },
58
+ )
47
59
const usedFonts = $ref <string []>([])
48
60
// https://www.cnblogs.com/gaidalou/p/8479452.html
49
61
const fontDetect = (font ? : string ) => {
Original file line number Diff line number Diff line change 6
6
hide-text
7
7
style =" width : 80px "
8
8
:select-options =" fontSizes"
9
- :select-value =" editor?.getAttributes('textStyle').fontSize || '14px'"
9
+ :select-value ="
10
+ isTypeRunning
11
+ ? null
12
+ : editor?.getAttributes('textStyle').fontSize || '14px'
13
+ "
10
14
v-bind =" $attrs"
11
15
:placeholder =" t('base.fontSize.text')"
12
16
filterable
@@ -43,7 +47,14 @@ const $toolbar = useState('toolbar', options)
43
47
const disableItem = (name : string ) => {
44
48
return options .value .toolbar ?.disableMenuItems .includes (name )
45
49
}
46
-
50
+ import { getTypewriterRunState } from ' @/extensions/type-writer'
51
+ let isTypeRunning = $ref (false )
52
+ watch (
53
+ () => getTypewriterRunState (),
54
+ (newValue : boolean ) => {
55
+ isTypeRunning = newValue
56
+ },
57
+ )
47
58
const fontSizes = [
48
59
{ label: t (' base.fontSize.default' ), value: ' 14px' , order: 4 },
49
60
{ label: t (' base.fontSize.42pt' ), value: ' 42pt' , order: 20 }, // 56
Original file line number Diff line number Diff line change @@ -219,3 +219,7 @@ export default Extension.create({
219
219
}
220
220
} ,
221
221
} )
222
+
223
+ export const getTypewriterRunState = ( ) => {
224
+ return typewriterState . value . isRunning
225
+ }
You can’t perform that action at this time.
0 commit comments