trigger drop down menus on touch in mobile
This commit is contained in:
parent
ea42cb3ddc
commit
22402e640a
5 changed files with 29 additions and 10 deletions
|
@ -102,6 +102,10 @@ var ComicBook = (function ($) {
|
|||
var page_requested = false; // used to request non preloaded pages
|
||||
var shiv = false;
|
||||
|
||||
if (navigator.userAgent.match(/mobile/i)) {
|
||||
document.body.classList.add('mobile');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the window.innerWidth - scrollbars
|
||||
*/
|
||||
|
@ -182,6 +186,13 @@ var ComicBook = (function ($) {
|
|||
window.addEventListener('hashchange', checkHash, false);
|
||||
}
|
||||
|
||||
window.addEventListener('touchstart', function (e) {
|
||||
var $dropdown, $el = $(e.target);
|
||||
if ($el.data('toggle') === 'dropdown' ) {
|
||||
$el.siblings('.dropdown').toggle();
|
||||
}
|
||||
}, false);
|
||||
|
||||
/**
|
||||
* Render Handlebars templates. Templates with data-trigger & data-action will
|
||||
* have the specified events bound.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue