[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

ojan at chromium.org ojan at chromium.org
Sun Feb 20 22:58:30 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 12a1a00691dc8f32d5b9998c181715a34e6944a4
Author: ojan at chromium.org <ojan at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 14 22:13:36 2011 +0000

    2011-01-14  Ojan Vafai  <ojan at chromium.org>
    
            Reviewed by Adam Barth.
    
            improve line selection with fast drags
            https://bugs.webkit.org/show_bug.cgi?id=52477
    
            * code-review.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75817 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Websites/bugs.webkit.org/ChangeLog b/Websites/bugs.webkit.org/ChangeLog
index 782ab8e..27f01e4 100644
--- a/Websites/bugs.webkit.org/ChangeLog
+++ b/Websites/bugs.webkit.org/ChangeLog
@@ -2,6 +2,15 @@
 
         Reviewed by Adam Barth.
 
+        improve line selection with fast drags
+        https://bugs.webkit.org/show_bug.cgi?id=52477
+
+        * code-review.js:
+
+2011-01-14  Ojan Vafai  <ojan at chromium.org>
+
+        Reviewed by Adam Barth.
+
         tweak line selection in code review tool
         https://bugs.webkit.org/show_bug.cgi?id=52462
 
diff --git a/Websites/bugs.webkit.org/code-review.js b/Websites/bugs.webkit.org/code-review.js
index 3555784..8ab7899 100644
--- a/Websites/bugs.webkit.org/code-review.js
+++ b/Websites/bugs.webkit.org/code-review.js
@@ -1046,12 +1046,12 @@
   }
 
   $('.lineNumber').live('click', function() {
-    var line = $(this).parents('.Line');
+    var line = lineFromLineDescendant($(this));
     if (line.hasClass('commentContext'))
       trimCommentContextToBefore(previousLineFor(line), line.attr('data-comment-base-line'));
   }).live('mousedown', function() {
     in_drag_select = true;
-    $(lineFromLineDescendant(this)).addClass('selected');
+    lineFromLineDescendant($(this)).addClass('selected');
     event.preventDefault();
   });
 
@@ -1066,6 +1066,17 @@
       return;
 
     var selected = $('.selected');
+
+    // Select all the lines between the first and last selected lines
+    // in case we didn't get mouseenter events for any of them.
+    var current_index = numberFrom(selected.first().attr('id'));
+    var last_index = numberFrom(selected.last().attr('id'));
+    while (current_index != last_index) {
+      $('#line' + current_index).addClass('selected')
+      current_index++;
+    }
+
+    selected = $('.selected');
     var already_has_comment = selected.last().hasClass('commentContext');
     selected.addClass('commentContext');
 
@@ -1073,7 +1084,7 @@
     if (already_has_comment)
       comment_base_line = selected.last().attr('data-comment-base-line');
     else {
-      var last = lineFromLineDescendant(selected.last()[0]);
+      var last = lineFromLineDescendant(selected.last());
       addCommentFor($(last));
       comment_base_line = last.id;
     }
@@ -1113,10 +1124,7 @@
   }
 
   function lineFromLineDescendant(descendant) {
-    while (descendant && !$(descendant).hasClass('Line')) {
-      descendant = descendant.parentNode;
-    }
-    return descendant;
+    return descendant.hasClass('Line') ? descendant : descendant.parents('.Line');
   }
 
   function lineFromLineContainer(lineContainer) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list