From 276509604d7bdcea4b1be89ed78be67d95ef816c Mon Sep 17 00:00:00 2001 From: Peter Parks Date: Tue, 24 Jan 2012 20:11:17 -0800 Subject: Fix hidden image map issue issue #461 img.getClientRects() was returning an empty object instead of false when the img map was not displayed. So instead of checking for a false object, check for the length of items instead. --- linkHints.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkHints.js b/linkHints.js index ce5b80ed..14747f16 100644 --- a/linkHints.js +++ b/linkHints.js @@ -132,7 +132,7 @@ var linkHints = { var img = document.querySelector("img[usemap='#" + map.getAttribute("name") + "']"); if (!img) continue; var imgClientRects = img.getClientRects(); - if (!imgClientRects) continue; + if (imgClientRects.length == 0) continue; var c = element.coords.split(/,/); var coords = [parseInt(c[0], 10), parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10)]; var rect = { -- cgit v1.2.3