Disable modal on small screens
[plack-app-gruntmaster.git] / js / 10-modal.js
index 1c290ef1252ce3d236f7c4208efd3fd45c4f3704..9bf83ce71f634aad3bfb124fcba63962edb6a782 100644 (file)
@@ -1,7 +1,8 @@
-let modal, hiding;
+let modal, backdrop, hiding;
 
 function show_modal () {
        modal.classList.remove('hidden');
+       backdrop.classList.remove('hidden');
        setTimeout(function (){
                document.body.classList.add('modal-open');
        }, 20);
@@ -12,7 +13,10 @@ function hide_modal () {
 }
 
 $(function() {
+       if(window.innerWidth < 768)
+               return;
        modal = $('.modal')[0];
+       backdrop = $('.backdrop')[0];
        $(modal).on('transitionend', el => {
                if(!document.body.classList.contains('modal-open'))
                        modal.classList.add('hidden');
This page took 0.010328 seconds and 4 git commands to generate.