mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	fix(tree): middle click triggering paste
This commit is contained in:
		
							parent
							
								
									65c33e1aa0
								
							
						
					
					
						commit
						bce2094fb2
					
				@ -244,6 +244,9 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
                const notePath = treeService.getNotePath(node);
 | 
					                const notePath = treeService.getNotePath(node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (notePath) {
 | 
					                if (notePath) {
 | 
				
			||||||
 | 
					                    e.stopPropagation();
 | 
				
			||||||
 | 
					                    e.preventDefault();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (e.ctrlKey) {
 | 
					                    if (e.ctrlKey) {
 | 
				
			||||||
                        appContext.triggerCommand("openInPopup", { noteIdOrPath: notePath });
 | 
					                        appContext.triggerCommand("openInPopup", { noteIdOrPath: notePath });
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
@ -252,7 +255,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
                        });
 | 
					                        });
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					        this.$tree.on("mouseup", ".fancytree-title", (e) => {
 | 
				
			||||||
 | 
					            // Prevent middle click from pasting in the editor.
 | 
				
			||||||
 | 
					            if (e.which === 2) {
 | 
				
			||||||
                e.stopPropagation();
 | 
					                e.stopPropagation();
 | 
				
			||||||
                e.preventDefault();
 | 
					                e.preventDefault();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user