mage-eventpress/js/mkb-admin.js

87 lines
3.5 KiB
JavaScript
Raw Normal View History

2020-12-13 07:25:42 -05:00
jQuery(document).ready(function ($) {
"use strict";
// Tabs
$(window).load(function () {
$('.mp_event_all_meta_in_tab .mp_tab_menu li:first-child[data-target-tabs]').trigger('click');
if ($('[name="mep_org_address"]').val() > 0) {
$('.mp_event_address').slideUp(250);
}
});
2020-09-20 07:49:01 -04:00
2020-12-13 07:25:42 -05:00
$(document).on('click', '[data-target-tabs]', function () {
if (!$(this).hasClass('active')) {
let tabsTarget = $(this).attr('data-target-tabs');
let targetParent = $(this).parents('.mp_event_all_meta_in_tab');
targetParent.find('.mp_tab_item.active').removeClass('active').slideUp('fast');
targetParent.find('.mp_tab_item[data-tab-item="' + tabsTarget + '"]').addClass('active').slideDown(250);
targetParent.find('li.active').removeClass('active');
$(this).addClass('active');
}
return false;
});
$('[name="mep_event_expire"]').datepicker({
dateFormat: "yy-mm-dd",
minDate: 0
});
$(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-09-20 07:49:01 -04:00
2020-12-13 07:25:42 -05:00
$('#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');
jQuery('.empty-row-t #mep_ticket_type_empty option[value=inputbox]').removeAttr('selected');
return false;
});
$('.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')
});
$('#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');
return false;
});
$('.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;
}
});
$('#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');
return false;
});
$('.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;
}
});
});