Skip to content

Commit

Permalink
Safeguard against IE6/7 event access exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jun 21, 2011
1 parent e03eb0b commit 962ed7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/codemirror.js
Expand Up @@ -1131,7 +1131,9 @@ var CodeMirror = (function() {
function paddingLeft() {return lineSpace.offsetLeft;}

function posFromMouse(e, liberal) {
var offW = eltOffset(scroller, true), x = e.e.clientX, y = e.e.clientY;
var offW = eltOffset(scroller, true), x, y;
// Fails unpredictably on IE[67] when mouse is dragged around quickly.
try { x = e.e.clientX; y = e.e.clientY; } catch (e) { return null; }
// This is a mess of a heuristic to try and determine whether a
// scroll-bar was clicked or not, and to return null if one was
// (and !liberal).
Expand Down

0 comments on commit 962ed7a

Please sign in to comment.