X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fb0f9556513d483807e8c23675d90a1b7698f305..8401cd0d140fd9bd0a2b12415745179e90c7e27a:/app/assets/javascripts/richtext.js diff --git a/app/assets/javascripts/richtext.js b/app/assets/javascripts/richtext.js index cb0bd1f27..1383a34df 100644 --- a/app/assets/javascripts/richtext.js +++ b/app/assets/javascripts/richtext.js @@ -32,4 +32,18 @@ $(document).ready(function () { preview.css("min-height", minHeight + "px"); }); + + var updateHelp = function () { + $(".richtext_container .richtext_help_sidebar:not(:visible):not(:empty)").each(function () { + var container = $(this).closest(".richtext_container"); + $(this).children().appendTo(container.find(".tab-pane[id$='_help']")); + }); + $(".richtext_container .richtext_help_sidebar:visible:empty").each(function () { + var container = $(this).closest(".richtext_container"); + container.find(".tab-pane[id$='_help']").children().appendTo($(this)); + }); + }; + + updateHelp(); + $(window).on("resize", updateHelp); });