mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Added workarounds to make Summernote embeds responsive (closes #1758)
This commit is contained in:
parent
8f7f88c8ad
commit
04a3069294
@ -677,7 +677,23 @@ $(document).on("click", ".easy-link-copy-textbox", function()
|
|||||||
|
|
||||||
$("textarea.wysiwyg-editor").summernote({
|
$("textarea.wysiwyg-editor").summernote({
|
||||||
minHeight: "300px",
|
minHeight: "300px",
|
||||||
lang: __t("summernote_locale")
|
lang: __t("summernote_locale"),
|
||||||
|
callbacks: {
|
||||||
|
onImageLinkInsert: function(url)
|
||||||
|
{
|
||||||
|
// Summernote workaround: Make images responsive
|
||||||
|
// By adding the "img-fluid" class to the img tag
|
||||||
|
$img = $('<img>').attr({ src: url, class: "img-fluid" })
|
||||||
|
$(this).summernote("insertNode", $img[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Summernote workaround: Make embeds responsive
|
||||||
|
// By wrapping any embeded video in a container with class "embed-responsive"
|
||||||
|
$(".note-video-clip").each(function()
|
||||||
|
{
|
||||||
|
$(this).parent().html('<div class="embed-responsive embed-responsive-16by9">' + $(this).wrap("<p/>").parent().html() + "</div>");
|
||||||
});
|
});
|
||||||
|
|
||||||
function LoadImagesLazy()
|
function LoadImagesLazy()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user