Skip to content

Instantly share code, notes, and snippets.

@brycejacobson
Created May 22, 2018 18:01
Show Gist options
  • Save brycejacobson/df9e96a5049c824e2299b3d6266a486b to your computer and use it in GitHub Desktop.
Save brycejacobson/df9e96a5049c824e2299b3d6266a486b to your computer and use it in GitHub Desktop.
Checking what-input and preventing dropdowns when input is touch
import $ from 'jquery';
import whatInput from 'what-input';
// Checking whatInput and stopping dropdowns on mobile
var html = document.querySelector('html');
var input = html.getAttribute('data-whatinput');
//console.log(input);
if(input == 'touch') {
$('.dropdown li:not(.no-mega-menu) a').click(function (e) {
e.preventDefault();
//console.log('test' + input);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment