mirror of
https://gh.wpcy.net/https://github.com/LJPc-solutions/freescout-calendar-module.git
synced 2026-07-16 11:16:38 +08:00
19 lines
846 B
JavaScript
19 lines
846 B
JavaScript
$(document).ready(function () {
|
|
$('.dash-card.ljpc_move_dash_card').each(function (i, el) {
|
|
$('.dash-cards').prepend(el);
|
|
});
|
|
|
|
// Check if there is an element with the class "add-attachment-to-calendar"
|
|
if ($('.add-attachment-to-calendar').length) {
|
|
// Get the data-attachment-id value from the element with the class "add-attachment-to-calendar"
|
|
var attachmentId = $('.add-attachment-to-calendar').data('attachment-id');
|
|
|
|
// Check if there is another element with the same data-attachment-id but without the "add-attachment-to-calendar" class
|
|
var elementToRemove = $('[data-attachment-id="' + attachmentId + '"]:not(.add-attachment-to-calendar)');
|
|
|
|
// If the element exists, remove it
|
|
if (elementToRemove.length) {
|
|
elementToRemove.remove();
|
|
}
|
|
}
|
|
});
|