implement print, closes #581

This commit is contained in:
zadam
2019-06-29 22:57:47 +02:00
parent 2f3b256272
commit c4b957427d
5 changed files with 361 additions and 2 deletions

View File

@@ -147,6 +147,26 @@ $noteTabContainer.on("click", ".export-note-button", function () {
$noteTabContainer.on("click", ".import-files-button", () => importDialog.showDialog(treeService.getActiveNode()));
$noteTabContainer.on("click", ".print-note-button", async function () {
if ($(this).hasClass("disabled")) {
return;
}
const $tabContext = noteDetailService.getActiveTabContext();
if (!$tabContext) {
return;
}
await libraryLoader.requireLibrary(libraryLoader.PRINT_THIS);
$tabContext.$tabContent.find('.note-detail-component:visible').printThis({
header: $("<h2>").text($tabContext.note && $tabContext.note.title).prop('outerHTML') ,
importCSS: false,
loadCSS: "libraries/codemirror/codemirror.css",
debug: true
});
});
$('[data-toggle="tooltip"]').tooltip({
html: true
});