| 1399 | } |
| 1400 | // prettier-ignore |
| 1401 | function getContentClientRect(target, win = window) { |
| 1402 | let rect = target.getBoundingClientRect(); |
| 1403 | let compStyle = win.getComputedStyle(target); |
| 1404 | let pFloat = parseFloat; |
| 1405 | let top = rect.top + pFloat(compStyle.paddingTop) + pFloat(compStyle.borderTopWidth); |
| 1406 | let right = rect.right - pFloat(compStyle.paddingRight) - pFloat(compStyle.borderRightWidth); |
| 1407 | let bottom = rect.bottom - pFloat(compStyle.paddingBottom) - pFloat(compStyle.borderBottomWidth); |
| 1408 | let left = rect.left + pFloat(compStyle.paddingLeft) + pFloat(compStyle.borderLeftWidth); |
| 1409 | return { |
| 1410 | top : top, |
| 1411 | right : right, |
| 1412 | bottom : bottom, |
| 1413 | left : left, |
| 1414 | width : right-left, |
| 1415 | height : bottom-top, |
| 1416 | }; |
| 1417 | } |
| 1418 | function onDoublePress(key, callback, timeout = 500) { |
| 1419 | let timer = null; |
| 1420 | let clickCount = 0; |