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"));
});
});