(e, liberal)
| 1869 | function paddingLeft() {return lineSpace.offsetLeft;} |
| 1870 | |
| 1871 | function posFromMouse(e, liberal) { |
| 1872 | var offW = eltOffset(scroller, true), x, y; |
| 1873 | // Fails unpredictably on IE[67] when mouse is dragged around quickly. |
| 1874 | try { x = e.clientX; y = e.clientY; } catch (e) { return null; } |
| 1875 | // This is a mess of a heuristic to try and determine whether a |
| 1876 | // scroll-bar was clicked or not, and to return null if one was |
| 1877 | // (and !liberal). |
| 1878 | if (!liberal && (x - offW.left > scroller.clientWidth || y - offW.top > scroller.clientHeight)) |
| 1879 | return null; |
| 1880 | var offL = eltOffset(lineSpace, true); |
| 1881 | return coordsChar(x - offL.left, y - offL.top); |
| 1882 | } |
| 1883 | function onContextMenu(e) { |
| 1884 | var pos = posFromMouse(e), scrollPos = scroller.scrollTop; |
| 1885 | if (!pos || window.opera) return; // Opera is difficult. |
no test coverage detected