mirror of
https://github.com/AdrienHallet/HaitiWater.git
synced 2026-11-13 17:52:05 +00:00
36 lines
781 B
JavaScript
36 lines
781 B
JavaScript
// Open modal with a form
|
|
$('.modal-with-form').magnificPopup({
|
|
type: 'inline',
|
|
preloader: false,
|
|
focus: '#name',
|
|
modal: true,
|
|
|
|
// Do not zoom on mobile
|
|
callbacks: {
|
|
beforeOpen: function() {
|
|
if($(window).width() < 700) {
|
|
this.st.focus = false;
|
|
} else {
|
|
this.st.focus = '#name';
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// Dismiss modal
|
|
$(document).on('click', '.modal-dismiss', function (e) {
|
|
e.preventDefault();
|
|
$.magnificPopup.close();
|
|
});
|
|
|
|
// Confirm modal
|
|
$(document).on('click', '.modal-confirm', function (e) {
|
|
e.preventDefault();
|
|
$.magnificPopup.close();
|
|
|
|
new PNotify({
|
|
title: 'Success!',
|
|
text: 'Modal Confirm Message.',
|
|
type: 'success'
|
|
});
|
|
}); |