mage-eventpress/js/mkb-admin.js

87 lines
3.8 KiB
JavaScript
Raw Normal View History

2020-12-14 07:10:30 -05:00
(function ($) {
2020-12-13 07:25:42 -05:00
"use strict";
$(window).load(function () {
2020-12-14 07:10:30 -05:00
$('.mp_tab_menu').each(function () {
$(this).find('ul li:first-child').trigger('click');
});
2020-12-13 07:25:42 -05:00
if ($('[name="mep_org_address"]').val() > 0) {
$('.mp_event_address').slideUp(250);
}
});
$(document).on('click', '[data-target-tabs]', function () {
if (!$(this).hasClass('active')) {
let tabsTarget = $(this).attr('data-target-tabs');
2020-12-14 07:10:30 -05:00
let targetParent = $(this).closest('.mp_event_tab_area').find('.mp_tab_details').first();
targetParent.children('.mp_tab_item:visible').slideUp('fast');
targetParent.children('.mp_tab_item[data-tab-item="' + tabsTarget + '"]').slideDown(250);
$(this).siblings('li.active').removeClass('active');
2020-12-13 07:25:42 -05:00
$(this).addClass('active');
}
return false;
});
$(document).on('click', 'label.mp_event_virtual_type_des_switch input', function () {
if ($(this).is(":checked")) {
$(this).parents('label.mp_event_virtual_type_des_switch').siblings('label.mp_event_virtual_type_des').slideDown(200);
} else {
$(this).parents('label.mp_event_virtual_type_des_switch').siblings('label.mp_event_virtual_type_des').val('').slideUp(200);
}
});
2020-12-17 05:11:50 -05:00
$(document).ready(function () {
$('#add-row-t').on('click', function () {
var row = $('.empty-row-t.screen-reader-text').clone(true);
row.removeClass('empty-row-t screen-reader-text');
row.insertBefore('#repeatable-fieldset-one-t tbody>tr:last');
$('#mep_ticket_type_empty option[value=inputbox]').attr('selected', 'selected');
$('.empty-row-t #mep_ticket_type_empty option[value=inputbox]').removeAttr('selected');
2020-12-13 07:25:42 -05:00
return false;
2020-12-17 05:11:50 -05:00
});
2020-12-13 07:25:42 -05:00
2020-12-17 05:11:50 -05:00
$('.remove-row-t').on('click', function () {
if (confirm('Are You Sure , Remove this row ? \n\n 1. Ok : To Remove . \n 2. Cancel : To Cancel .')) {
$(this).parents('tr').remove();
$('#mep_ticket_type_empty option[value=inputbox]').removeAttr('selected');
$('#mep_ticket_type_empty option[value=dropdown]').removeAttr('selected');
} else {
return false;
}
});
$(document).find('.mp_event_type_sortable').sortable({
handle: $(this).find('.mp_event_type_sortable_button')
});
2020-12-13 07:25:42 -05:00
2020-12-17 05:11:50 -05:00
$('#add-row').on('click', function () {
var row = $('.empty-row.screen-reader-text').clone(true);
row.removeClass('empty-row screen-reader-text');
row.insertBefore('#repeatable-fieldset-one tbody>tr:last');
2020-12-13 07:25:42 -05:00
return false;
2020-12-17 05:11:50 -05:00
});
2020-12-13 07:25:42 -05:00
2020-12-17 05:11:50 -05:00
$('.remove-row').on('click', function () {
if (confirm('Are You Sure , Remove this row ? \n\n 1. Ok : To Remove . \n 2. Cancel : To Cancel .')) {
$(this).parents('tr').remove();
} else {
return false;
}
});
2020-12-13 07:25:42 -05:00
2020-12-17 05:11:50 -05:00
$('#add-new-date-row').on('click', function () {
var row = $('.empty-row-d.screen-reader-text').clone(true);
row.removeClass('empty-row-d screen-reader-text');
row.insertBefore('#repeatable-fieldset-one-d tbody>tr:last');
2020-12-13 07:25:42 -05:00
return false;
2020-12-17 05:11:50 -05:00
});
$('.remove-row-d').on('click', function () {
if (confirm('Are You Sure , Remove this row ? \n\n 1. Ok : To Remove . \n 2. Cancel : To Cancel .')) {
$(this).parents('tr').remove();
} else {
return false;
}
});
2020-12-17 00:27:30 -05:00
});
2021-11-24 01:51:57 -05:00
$(document).on('keyup change', '.mp_ticket_type_table [name="option_name_t[]"],.mp_ticket_type_table [name="option_name[]"]', function () {
let n = $(this).val();
$(this).val(n.replace(/[^a-z0-9-_\s]/gi, ''));
});
2020-12-14 07:10:30 -05:00
}(jQuery));