(e, liberal)
| 1669 | function paddingLeft() {return lineSpace.offsetLeft;} |
| 1670 | |
| 1671 | function posFromMouse(e, liberal) { |
| 1672 | var offW = eltOffset(scroller, true), x, y; |
| 1673 | // Fails unpredictably on IE[67] when mouse is dragged around quickly. |
| 1674 | try { x = e.clientX; y = e.clientY; } catch (e) { return null; } |
| 1675 | // This is a mess of a heuristic to try and determine whether a |
| 1676 | // scroll-bar was clicked or not, and to return null if one was |
| 1677 | // (and !liberal). |
| 1678 | if (!liberal && (x - offW.left > scroller.clientWidth || y - offW.top > scroller.clientHeight)) |
| 1679 | return null; |
| 1680 | var offL = eltOffset(lineSpace, true); |
| 1681 | return coordsChar(x - offL.left, y - offL.top); |
| 1682 | } |
| 1683 | function onContextMenu(e) { |
| 1684 | var pos = posFromMouse(e), scrollPos = scroller.scrollTop; |
| 1685 | if (!pos || window.opera) return; // Opera is difficult. |
no test coverage detected