Merge branch 'Limiting-horizontal-pane-extension' of https://github.com/KhadishaKudys/trilium into Limiting-horizontal-pane-extension

This commit is contained in:
KhadishaKenzhebekkyzy 2022-04-17 16:37:34 +06:00
commit 4b5294525b
5 changed files with 24 additions and 5 deletions

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
"name": "trilium", "name": "trilium",
"productName": "Trilium Notes", "productName": "Trilium Notes",
"description": "Trilium Notes", "description": "Trilium Notes",
"version": "0.50.2", "version": "0.50.3",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"main": "electron.js", "main": "electron.js",
"bin": { "bin": {

View file

@ -17,11 +17,12 @@ const TPL = `<div class="mermaid-widget">
.mermaid-render { .mermaid-render {
overflow: auto; overflow: auto;
height: 100%; height: 100%;
text-align: center;
} }
</style> </style>
<div class="mermaid-error alert alert-warning"> <div class="mermaid-error alert alert-warning">
<p><strong>The diagram could not displayed. See <a href="https://mermaid-js.github.io/mermaid/#/flowchart?id=graph">help and examples</a>.</strong></p> <p><strong>The diagram could not be displayed. See <a href="https://mermaid-js.github.io/mermaid/#/flowchart?id=graph">help and examples</a>.</strong></p>
<p class="error-content"></p> <p class="error-content"></p>
</div> </div>
@ -70,8 +71,25 @@ export default class MermaidWidget extends NoteContextAwareWidget {
this.$display.empty(); this.$display.empty();
const libLoaded = libraryLoader.requireLibrary(libraryLoader.WHEEL_ZOOM);
try { try {
mermaid.mermaidAPI.render('mermaid-graph-' + idCounter++, content, content => this.$display.html(content)); const idNumber = idCounter++;
mermaid.mermaidAPI.render('mermaid-graph-' + idNumber, content, async content => {
this.$display.html(content);
await libLoaded;
this.$display.attr("id", 'mermaid-render-' + idNumber);
WZoom.create('#mermaid-render-' + idNumber, {
type: 'html',
maxScale: 10,
speed: 20,
zoomOnClick: false
});
});
this.$errorContainer.hide(); this.$errorContainer.hide();
} catch (e) { } catch (e) {

View file

@ -49,6 +49,7 @@ class ImageTypeWidget extends TypeWidget {
libraryLoader.requireLibrary(libraryLoader.WHEEL_ZOOM).then(() => { libraryLoader.requireLibrary(libraryLoader.WHEEL_ZOOM).then(() => {
WZoom.create('#' + this.$imageView.attr("id"), { WZoom.create('#' + this.$imageView.attr("id"), {
maxScale: 10, maxScale: 10,
speed: 20,
zoomOnClick: false zoomOnClick: false
}); });
}); });

View file

@ -1 +1 @@
module.exports = { buildDate:"2022-02-09T22:52:36+01:00", buildRevision: "23daaa2387a0655685377f0a541d154aeec2aae8" }; module.exports = { buildDate:"2022-03-22T21:30:21+01:00", buildRevision: "2f57d55bea11a840a158fb0431d267186a32482a" };