mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	feat(mobile): reposition dropdowns to point up instead of down
This commit is contained in:
		
							parent
							
								
									e23b2f3ddd
								
							
						
					
					
						commit
						326c409e47
					
				@ -252,6 +252,23 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
 | 
			
		||||
 | 
			
		||||
                if (utils.isMobile()) {
 | 
			
		||||
                    $classicToolbarWidget.addClass("visible");
 | 
			
		||||
 | 
			
		||||
                    // Reposition all dropdowns to point upwards instead of downwards.
 | 
			
		||||
                    // See https://ckeditor.com/docs/ckeditor5/latest/examples/framework/bottom-toolbar-editor.html for more info.
 | 
			
		||||
                    const toolbarView = editor.ui.view.toolbar;
 | 
			
		||||
                    for (const item of toolbarView.items) {
 | 
			
		||||
                        if (!("panelView" in item)) {
 | 
			
		||||
                            continue;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        item.on("change:isOpen", () => {
 | 
			
		||||
                            if ( !item.isOpen ) {
 | 
			
		||||
                                return;
 | 
			
		||||
                            }
 | 
			
		||||
 | 
			
		||||
                            item.panelView.position = item.panelView.position.replace("s", "n");
 | 
			
		||||
                        });
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user