Browse Source

Update modals.js

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

10
js/modals.js

@ -29,13 +29,17 @@
}
};
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