From 687b9d1bef75f331635d1d2ba0b4512158784026 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 3 Mar 2019 00:31:41 +0000 Subject: [PATCH] All: Improve rendering of Mermaid graphs --- ElectronClient/app/gui/Navigator.jsx | 6 +++++- ReactNativeClient/lib/MdToHtml_Mermaid.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ElectronClient/app/gui/Navigator.jsx b/ElectronClient/app/gui/Navigator.jsx index d4f5fe8d36..5905f8c5b8 100644 --- a/ElectronClient/app/gui/Navigator.jsx +++ b/ElectronClient/app/gui/Navigator.jsx @@ -17,7 +17,11 @@ class NavigatorComponent extends Component { } updateWindowTitle(title) { - if (bridge().window()) bridge().window().setTitle(title); + try { + if (bridge().window()) bridge().window().setTitle(title); + } catch (error) { + console.warn('updateWindowTitle', error); + } } render() { diff --git a/ReactNativeClient/lib/MdToHtml_Mermaid.js b/ReactNativeClient/lib/MdToHtml_Mermaid.js index 20efea36a4..383d7f620f 100644 --- a/ReactNativeClient/lib/MdToHtml_Mermaid.js +++ b/ReactNativeClient/lib/MdToHtml_Mermaid.js @@ -15,7 +15,7 @@ class MdToHtml_Mermaid { // Force a white background because the graphs can have various colours // that may not be compatible with the current theme. Also make it // inline-block so that the div is the same size as the content. - return '.mermaid { background-color: white; display:inline-block; }'; + return '.mermaid { width: 100%; } .mermaid svg { background-color: white; }'; } injectedJavaScript() {