You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.6 KiB
48 lines
1.6 KiB
const WorkshopInformer = {
|
|
register: (event_id = null, email_address = null) => {
|
|
Helper.help.ajax(app.get_vars().baseurl + "workshop/register", "post",
|
|
{ email_address, event_id },
|
|
(result) => {
|
|
app._notify(result.mtype, result.message);
|
|
|
|
if (result.mtype == "success") {
|
|
$("#workshop_informer_email").val('');
|
|
}
|
|
|
|
});
|
|
},
|
|
}
|
|
|
|
$(function() {
|
|
$("#reg-workshop-informer").on('click', (event) => {
|
|
let email_address = $("#workshop_informer_email").val().trim();
|
|
let event_id = $(event.target).data('event-id');
|
|
|
|
if (!email_address || !event_id)
|
|
return;
|
|
if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email_address))
|
|
return app._notify('error', 'Invalid email address');
|
|
|
|
WorkshopInformer.register(event_id, email_address);
|
|
});
|
|
// For mobile bug
|
|
$("#reg-workshop-informer-mobile").on('click', (event) => {
|
|
let email_address = $("#workshop_informer_email_mobile").val().trim();
|
|
let event_id = $(event.target).data('event-id');
|
|
|
|
if (!email_address || !event_id)
|
|
return;
|
|
if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email_address))
|
|
return app._notify('error', 'Invalid email address');
|
|
|
|
WorkshopInformer.register(event_id, email_address);
|
|
});
|
|
});
|
|
|
|
// UI coming soon sliding popop
|
|
$( ".toggleSliderInfoBox" ).click(function() {
|
|
$('.mobile-info-box').toggleClass('active');
|
|
});
|
|
$( ".toggleSliderInfoBoxBottom" ).click(function() {
|
|
$('.info-box-bottom').toggleClass('active');
|
|
});
|