Browse Source

Correct turn of the modal window from getModal

* Looks like I hastily changed it during review with @fat. Oops! :-)
pull/135/head
Ben Schwarz 12 years ago
parent
commit
ff3808b37b
  1. 3
      lib/js/modals.js

3
lib/js/modals.js

@ -8,7 +8,6 @@
var findModals = function (target) { var findModals = function (target) {
var i; var i;
var modals = document.querySelectorAll('a'); var modals = document.querySelectorAll('a');
for (; target && target !== document; target = target.parentNode) { for (; target && target !== document; target = target.parentNode) {
for (i = modals.length; i--;) { if (modals[i] === target) return target; } for (i = modals.length; i--;) { if (modals[i] === target) return target; }
} }
@ -16,7 +15,7 @@
var getModal = function (event) { var getModal = function (event) {
var modalToggle = findModals(event.target); var modalToggle = findModals(event.target);
if (!modalToggle || !modalToggle.hash) return document.querySelector(modalToggle.hash); if (modalToggle && modalToggle.hash) return document.querySelector(modalToggle.hash);
}; };
window.addEventListener('touchend', function (event) { window.addEventListener('touchend', function (event) {

Loading…
Cancel
Save