Voucher bulk creation: Add markdown preview for email field (#3143)

This commit is contained in:
Raphael Michel
2023-03-15 15:55:34 +01:00
committed by GitHub
parent 859004ec59
commit c9e5cce7d0
6 changed files with 123 additions and 11 deletions

View File

@@ -30,11 +30,9 @@ function preview_task_error(item) {
}
}
$(function () {
"use strict";
$('.mail-preview .placeholder').tooltip();
$('a[type=preview]').on('click', function () {
function mail_preview_setup($el) {
$el.find('.mail-preview .placeholder').tooltip();
$el.find('a[type=preview]').on('click', function () {
var itemName = $(this).closest('.preview-panel').attr('for');
if ($('#' + itemName + '_panel').data('ajaxing') || $(this).parent('.active').length !== 0) {
return;
@@ -66,4 +64,12 @@ $(function () {
);
});
}
$(function () {
"use strict";
mail_preview_setup($("body"));
$(document).on("pretix:bind-forms", function () {
mail_preview_setup($("body"));
});
});

View File

@@ -181,7 +181,7 @@ div.mail-preview {
border-top-width: 0;
margin-bottom: 0;
padding-right: 15px;
padding-bottom: 15px;
padding-bottom: 8px;
&:first-child {
@include border-top-radius($input-border-radius);
@@ -217,6 +217,12 @@ div.mail-preview {
p:last-child {
margin-bottom: 0;
}
/* Reset styling from bootstrap that we don't actually have in emails */
pre {
background: none;
border: none;
padding: 0;
}
}
.search-line {