<p></p>
<p><b>@tomhughes</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5116#discussion_r1749259864">app/assets/javascripts/richtext.js</a>:</p>
<pre style='color:#555'>> });
- /*
- * Install a handler to switch to preview mode
- */
- $(".richtext_container button[data-bs-target$='_preview']").on("show.bs.tab", function () {
- var container = $(this).closest(".richtext_container");
- var editor = container.find("textarea");
- var preview = container.find(".tab-pane[id$='_preview']");
+ $(document).on("turbo:load", function () {
+ /*
+ * When the text in an edit pane is changed, clear the contents of
+ * the associated preview pne so that it will be regenerated when
+ * the user next switches to it.
+ */
+ $(".richtext_container textarea").change(function () {
</pre>
<p dir="auto">Hmm that's unfortunate... Maybe we should leave it in <code class="notranslate">turbo:load</code> then? But it would need to be converted to a named function so that it won't get installed more than once on the same element.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5116#discussion_r1749259864">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLK4GZMKLZUX2FMQ5WDZVRQV3AVCNFSM6AAAAABNBVGYGCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEOBYGU2TGMJWHA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOHGYBON4QGNG3FSHLZVRQV3A5CNFSM6AAAAABNBVGYGCWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUINCGNA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5116/review/2288553168</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5116#discussion_r1749259864",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5116#discussion_r1749259864",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>