/*
* Install a handler to switch to preview mode
*/
- $(".richtext_dopreview").on("show.bs.tab", function () {
+ $(".richtext_container button[data-bs-target$='_preview']").on("show.bs.tab", function () {
var editor = $(this).parents(".richtext_container").find("textarea");
var preview = $(this).parents(".richtext_container").find(".richtext_preview");
var minHeight = editor.outerHeight() - preview.outerHeight() + preview.height();
<button type="button" class="nav-link active" data-bs-toggle="tab" data-bs-target="#<%= id %>_edit"><%= t(".edit") %></button>
</li>
<li class="nav-item">
- <button type="button" class="nav-link richtext_dopreview" data-bs-toggle="tab" data-bs-target="#<%= id %>_preview"><%= t(".preview") %></button>
+ <button type="button" class="nav-link" data-bs-toggle="tab" data-bs-target="#<%= id %>_preview"><%= t(".preview") %></button>
</li>
</ul>
<div class="tab-content">