Commit 7579ac83 authored by abarth@webkit.org's avatar abarth@webkit.org

2010-08-29 Adam Barth <abarth@webkit.org>

        Attempt to make Sam's life easier by not opening a comment text field
        if there's a selection.  This should make it easier to copy/paste text
        out of the diff without accidentally opening comment boxes.

        * code-review.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent acc4bb37
2010-08-29 Adam Barth <abarth@webkit.org>
Attempt to make Sam's life easier by not opening a comment text field
if there's a selection. This should make it easier to copy/paste text
out of the diff without accidentally opening comment boxes.
* code-review.js:
2010-08-29 Adam Barth <abarth@webkit.org>
Turns out we're supposed to use find instead of children here.
......
......@@ -72,6 +72,8 @@
var line = $('#' + id);
if (line.attr('data-has-comment'))
return;
if (!window.getSelection().isCollapsed)
return; // If there's a selection, we assume the user wants to copy the text.
line.attr('data-has-comment', 'true');
var comment_block = $('<div class="comment"><div class="actions"><img class="delete" src="' + kDeleteImage + '"></div><textarea data-comment-for="' + id + '"></textarea></div>');
insertCommentFor(line, comment_block);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment