Remove .richtext_preview css class
This commit is contained in:
parent
6ebf98255c
commit
8103eb18ab
2 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ $(document).ready(function () {
|
||||||
* the user next switches to it.
|
* the user next switches to it.
|
||||||
*/
|
*/
|
||||||
$(".richtext_container textarea").change(function () {
|
$(".richtext_container textarea").change(function () {
|
||||||
$(this).parents(".richtext_container").find(".richtext_preview").empty();
|
$(this).parents(".richtext_container").find(".tab-pane[id$='_preview']").empty();
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -13,7 +13,7 @@ $(document).ready(function () {
|
||||||
*/
|
*/
|
||||||
$(".richtext_container button[data-bs-target$='_preview']").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 editor = $(this).parents(".richtext_container").find("textarea");
|
||||||
var preview = $(this).parents(".richtext_container").find(".richtext_preview");
|
var preview = $(this).parents(".richtext_container").find(".tab-pane[id$='_preview']");
|
||||||
var minHeight = editor.outerHeight() - preview.outerHeight() + preview.height();
|
var minHeight = editor.outerHeight() - preview.outerHeight() + preview.height();
|
||||||
|
|
||||||
if (preview.contents().length === 0) {
|
if (preview.contents().length === 0) {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<div id="<%= id %>_edit" class="tab-pane show active">
|
<div id="<%= id %>_edit" class="tab-pane show active">
|
||||||
<%= builder.text_area(attribute, options.merge(:wrapper => false, "data-preview-url" => preview_url(:type => type))) %>
|
<%= builder.text_area(attribute, options.merge(:wrapper => false, "data-preview-url" => preview_url(:type => type))) %>
|
||||||
</div>
|
</div>
|
||||||
<div id="<%= id %>_preview" class="tab-pane richtext_preview richtext text-break"></div>
|
<div id="<%= id %>_preview" class="tab-pane richtext text-break"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="<%= id %>_help" class="col-sm-4 richtext_help">
|
<div id="<%= id %>_help" class="col-sm-4 richtext_help">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue