mirror of https://github.com/JustKato/FreePad.git
* Fixed preview not updating
This commit is contained in:
parent
6cc1628e77
commit
1b1fe59877
|
@ -164,6 +164,8 @@ class PadSocket {
|
||||||
this.sendMessage(`padUpdate`, {
|
this.sendMessage(`padUpdate`, {
|
||||||
"content": padContents,
|
"content": padContents,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updatePadContent(padContents, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -172,9 +174,9 @@ class PadSocket {
|
||||||
* Update the contents of the pad
|
* Update the contents of the pad
|
||||||
* @param {String} newContent
|
* @param {String} newContent
|
||||||
*/
|
*/
|
||||||
function updatePadContent(newContent) {
|
function updatePadContent(newContent, textArea = true) {
|
||||||
// Update the textarea
|
// Update the textarea
|
||||||
document.getElementById(`pad-content`).value = newContent;
|
if ( textArea ) document.getElementById(`pad-content`).value = newContent;
|
||||||
// Update the preview
|
// Update the preview
|
||||||
document.getElementById(`textarea-preview`).innerHTML = newContent;
|
document.getElementById(`textarea-preview`).innerHTML = newContent;
|
||||||
// TODO: Re-run the syntax highlight
|
// TODO: Re-run the syntax highlight
|
||||||
|
|
Loading…
Reference in New Issue