Browse Source

Update modals.js

Added click handler for desktop compatibility
pull/610/head
ShmidtIvan 11 years ago
parent
commit
419fe808ee
  1. 12
      js/modals.js

12
js/modals.js

@ -28,14 +28,18 @@
return document.querySelector(modalToggle.hash);
}
};
window.addEventListener('touchend', function (event) {
var openModal = function (event) {
var modal = getModal(event);
if (modal) {
if (modal && modal.classList.contains('modal')) {
modal.classList.toggle('active');
}
$(window).trigger("modalOpened", {smth:modal});
event.preventDefault(); // prevents rewriting url (apps can still use hash values in url)
}
});
}());
};
//Added click for desktop compatibility
window.addEventListener('click', openModal);
window.addEventListener('touchend', openModal);
})();

Loading…
Cancel
Save