mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 07:01:31 +08:00 
			
		
		
		
	pdf preview is now also available in include note, book etc.
This commit is contained in:
		
							parent
							
								
									6a1bfdeab9
								
							
						
					
					
						commit
						a5764c269f
					
				@ -45,7 +45,16 @@ async function getRenderedContent(note) {
 | 
				
			|||||||
        // open doesn't work for protected notes since it works through browser which isn't in protected session
 | 
					        // open doesn't work for protected notes since it works through browser which isn't in protected session
 | 
				
			||||||
        $openButton.toggle(!note.isProtected);
 | 
					        $openButton.toggle(!note.isProtected);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $rendered = $('<div>')
 | 
					        $rendered = $('<div>');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (note.mime === 'application/pdf' && utils.isElectron()) {
 | 
				
			||||||
 | 
					            const $pdfPreview = $('<iframe class="pdf-preview" style="width: 100%; height: 100%; flex-grow: 100;"></iframe>');
 | 
				
			||||||
 | 
					            $pdfPreview.attr("src", utils.getUrlForDownload("api/notes/" + note.noteId + "/open"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $rendered.append($pdfPreview);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $rendered
 | 
				
			||||||
            .append($downloadButton)
 | 
					            .append($downloadButton)
 | 
				
			||||||
            .append('   ')
 | 
					            .append('   ')
 | 
				
			||||||
            .append($openButton);
 | 
					            .append($openButton);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user