Skip to content

Commit

Permalink
Issue 6899 (Exception when clicking outside of the inline editor's
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianZ committed Oct 24, 2013
1 parent 346ee10 commit 1aa7077
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extension/content/firebug/chrome/chrome.js
Expand Up @@ -2126,7 +2126,8 @@ function onPanelMouseUp(event)
var selectionData;
var unselectedRange = event.target.ownerDocument.createRange();
var selectedRange = selection.getRangeAt(0);
unselectedRange.setStart(editable.firstElementChild || editable, 0);
var referenceElement = editable || event.target;
unselectedRange.setStart(referenceElement.firstElementChild || referenceElement, 0);
unselectedRange.setEnd(selectedRange.startContainer, selectedRange.startOffset);

if (selectedRange.collapsed)
Expand All @@ -2135,7 +2136,7 @@ function onPanelMouseUp(event)
Math.abs(event.screenY - lastMouseDownPosition.y);

// If mouse has moved far enough, set selection at that point
if (distance > 3)
if (distance > 3 || referenceElement === event.target)
{
selectionData =
{
Expand Down

0 comments on commit 1aa7077

Please sign in to comment.