Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix readonly mode content not loaded properly

ammarahm-ed8a26aea4093f
diff --git a/apps/mobile/html/Web.bundle/site/constants.js b/apps/mobile/html/Web.bundle/site/constants.js
index 082fb6672..40aacb3b1 100755
--- a/apps/mobile/html/Web.bundle/site/constants.js
+++ b/apps/mobile/html/Web.bundle/site/constants.js
@@ -599,6 +599,7 @@ pre code {
background-color: transparent !important;
font-size: 10pt !important;
padding: 0px 0px 0px 0px !important;
+ overflow-x:auto;
}
`;
@@ -1009,6 +1010,7 @@ table[data-mce-selected] th[data-mce-active] {
background-color: ${pageTheme.colors.nav} !important;
}
+
code:not(pre code),
.hljs {
background-color: ${pageTheme.colors.nav} !important;
diff --git a/apps/mobile/html/Web.bundle/site/listeners.js b/apps/mobile/html/Web.bundle/site/listeners.js
index f9c1c7492..c9d6faad3 100755
--- a/apps/mobile/html/Web.bundle/site/listeners.js
+++ b/apps/mobile/html/Web.bundle/site/listeners.js
@@ -179,9 +179,16 @@ function attachMessageListener() {
globalThis.isClearingNoteData = false;
reactNativeEventHandler('noteLoaded', true);
}
+
if (!value.readOnly) {
tinymce.activeEditor.mode.set('design');
+ document.getElementById('titleInput').readOnly = false;
+ } else {
+ tinymce.activeEditor.mode.set('design');
+ tinymce.activeEditor.mode.set('readonly');
+ document.getElementById('titleInput').readOnly = true;
}
+
info = document.querySelector(infoBar);
info.querySelector('#infowords').innerText = editor.countWords() + ' words';
updateInfoBar();