tissue/resources/assets/js/app.js
shibafu 8a8ca1a26e
Merge pull request #148 from shikorism/fix/145-show-delete-modal-manually
削除モーダルの初期化が完了してから削除ボタンクリックイベントを仕掛ける
2019-03-12 19:48:05 +09:00

30 lines
930 B
JavaScript
Vendored

import Cookies from 'js-cookie';
require('./bootstrap');
$(() => {
if (Cookies.get('agechecked')) {
$('body').removeClass('tis-need-agecheck');
} else {
$('#ageCheckModal')
.modal({backdrop: 'static'})
.on('hide.bs.modal', function () {
$('body').removeClass('tis-need-agecheck');
Cookies.set('agechecked', '1', {expires: 365});
});
}
if (navigator.serviceWorker) {
navigator.serviceWorker.register('/sw.js');
}
$('[data-toggle="tooltip"]').tooltip();
$('.alert').alert();
$('.tis-page-selector').pageSelector();
$('.link-card').linkCard();
const $deleteCheckinModal = $('#deleteCheckinModal').deleteCheckinModal();
$(document).on('click', '[data-target="#deleteCheckinModal"]', function (event) {
event.preventDefault();
$deleteCheckinModal.modal('show', this);
});
});