File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
src/components/modules/toolbar Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,6 @@ export default class InlineToolbar extends Module<InlineToolbarNodes> {
76
76
// Get the value from the config
77
77
this . align = config . alignInlineToolbar ?? 'left' ;
78
78
79
- console . log ( this . align ) ;
80
-
81
79
window . requestIdleCallback ( ( ) => {
82
80
this . make ( ) ;
83
81
} , { timeout : 2000 } ) ;
@@ -232,13 +230,17 @@ export default class InlineToolbar extends Module<InlineToolbarNodes> {
232
230
233
231
let newX : number ;
234
232
235
- // Calculate x based on alignment
236
- if ( this . align === 'left' ) {
237
- newX = selectionRect . x - wrapperOffset . x ;
238
- } else if ( this . align === 'right' ) {
239
- newX = selectionRect . x + selectionRect . width - popoverWidth - wrapperOffset . x ;
240
- } else { // center (default)
241
- newX = selectionRect . x + selectionRect . width / 2 - popoverWidth / 2 - wrapperOffset . x ;
233
+ switch ( this . align ) {
234
+ default :
235
+ case 'left' :
236
+ newX = selectionRect . x - wrapperOffset . x ;
237
+ break ;
238
+ case 'right' :
239
+ newX = selectionRect . x + selectionRect . width - popoverWidth - wrapperOffset . x ;
240
+ break ;
241
+ case 'center' :
242
+ newX = selectionRect . x + selectionRect . width / 2 - popoverWidth / 2 - wrapperOffset . x ;
243
+ break ;
242
244
}
243
245
244
246
const newCoords = {
You can’t perform that action at this time.
0 commit comments