(ip)
| 3331 | if (cv) cv.addEventListener('click', (e) => { |
| 3332 | // A just-finished drag/pan (or a press on an existing object) must not |
| 3333 | // also place a new AP / sample here. |
| 3334 | if (_wifiHm.suppressClick) { _wifiHm.suppressClick = false; return; } |
| 3335 | const rect = cv.getBoundingClientRect(); |
| 3336 | const vp = _wifiHmViewport(cv.clientWidth, cv.clientHeight || cv.clientWidth); |
| 3337 | const x = vp.fromX(e.clientX - rect.left); |
| 3338 | const y = vp.fromY(e.clientY - rect.top); |
| 3339 | if (x < 0 || x > 1 || y < 0 || y > 1) return; // ruler margin / outside the floor |
| 3340 | if (_wifiHm.mode === 'design') { _wifiHmDesignClick(x, y); return; } |
| 3341 | const sel = document.getElementById('wifi-hm-ap'); |
no test coverage detected