mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 11:56:01 +01:00 
			
		
		
		
	print should include promoted attributes, #2550
This commit is contained in:
		@@ -21,6 +21,7 @@ import ReadOnlyCodeTypeWidget from "./type_widgets/read_only_code.js";
 | 
				
			|||||||
import NoneTypeWidget from "./type_widgets/none.js";
 | 
					import NoneTypeWidget from "./type_widgets/none.js";
 | 
				
			||||||
import attributeService from "../services/attributes.js";
 | 
					import attributeService from "../services/attributes.js";
 | 
				
			||||||
import NoteMapTypeWidget from "./type_widgets/note_map.js";
 | 
					import NoteMapTypeWidget from "./type_widgets/note_map.js";
 | 
				
			||||||
 | 
					import attributeRenderer from "../services/attribute_renderer.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const TPL = `
 | 
					const TPL = `
 | 
				
			||||||
<div class="note-detail">
 | 
					<div class="note-detail">
 | 
				
			||||||
@@ -222,8 +223,17 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        await libraryLoader.requireLibrary(libraryLoader.PRINT_THIS);
 | 
					        await libraryLoader.requireLibrary(libraryLoader.PRINT_THIS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        let $promotedAttributes = $("");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (this.note.getPromotedDefinitionAttributes().length > 0) {
 | 
				
			||||||
 | 
					            $promotedAttributes = (await attributeRenderer.renderNormalAttributes(this.note)).$renderedAttributes;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.$widget.find('.note-detail-printable:visible').printThis({
 | 
					        this.$widget.find('.note-detail-printable:visible').printThis({
 | 
				
			||||||
            header: $("<h2>").text(this.note && this.note.title).prop('outerHTML'),
 | 
					            header: $("<div>")
 | 
				
			||||||
 | 
					                        .append($("<h2>").text(this.note.title))
 | 
				
			||||||
 | 
					                        .append($promotedAttributes)
 | 
				
			||||||
 | 
					                        .prop('outerHTML'),
 | 
				
			||||||
            footer: `
 | 
					            footer: `
 | 
				
			||||||
<script src="libraries/katex/katex.min.js"></script>
 | 
					<script src="libraries/katex/katex.min.js"></script>
 | 
				
			||||||
<script src="libraries/katex/mhchem.min.js"></script>
 | 
					<script src="libraries/katex/mhchem.min.js"></script>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user