File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ const css = `
29
29
border-radius: 100%;
30
30
background-color: red;
31
31
}
32
+ .live-translator-badge-wrapper {
33
+ position: relative !important;
34
+ width: 0px;
35
+ height: 0px;
36
+ }
32
37
.live-translator-badge-container {
33
38
position: absolute !important;
34
39
display: flex;
@@ -222,7 +227,10 @@ class LiveTranslatorManager {
222
227
else {
223
228
container = document . createElement ( 'span' ) ;
224
229
container . classList . add ( 'live-translator-badge-container' ) ;
225
- parent . insertBefore ( container , node ) ;
230
+ const relativeWrapper = document . createElement ( 'span' ) ;
231
+ relativeWrapper . classList . add ( 'live-translator-badge-wrapper' ) ;
232
+ relativeWrapper . appendChild ( container ) ;
233
+ parent . insertBefore ( relativeWrapper , node ) ;
226
234
}
227
235
for ( const badge of badges ) {
228
236
container . appendChild ( badge ) ;
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ const css = `
24
24
border-radius: 100%;
25
25
background-color: red;
26
26
}
27
+ .live-translator-badge-wrapper {
28
+ position: relative !important;
29
+ width: 0px;
30
+ height: 0px;
31
+ }
27
32
.live-translator-badge-container {
28
33
position: absolute !important;
29
34
display: flex;
@@ -121,7 +126,6 @@ abstract class ZeroWidthEncoder {
121
126
class LiveTranslatorManager {
122
127
_enabled : boolean
123
128
_options : LiveTranslatorPluginOptions
124
- _callback : CallableFunction
125
129
126
130
_enableButton : HTMLButtonElement
127
131
_indicator : HTMLSpanElement
@@ -259,7 +263,10 @@ class LiveTranslatorManager {
259
263
} else {
260
264
container = document . createElement ( 'span' )
261
265
container . classList . add ( 'live-translator-badge-container' )
262
- parent . insertBefore ( container , node )
266
+ const relativeWrapper = document . createElement ( 'span' )
267
+ relativeWrapper . classList . add ( 'live-translator-badge-wrapper' )
268
+ relativeWrapper . appendChild ( container )
269
+ parent . insertBefore ( relativeWrapper , node )
263
270
}
264
271
for ( const badge of badges ) {
265
272
container . appendChild ( badge )
You can’t perform that action at this time.
0 commit comments