diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -471,7 +471,7 @@ 'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', 'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0', 'rsrc/js/core/behavior-lightbox-attachments.js' => '6b31879a', - 'rsrc/js/core/behavior-line-linker.js' => 'febf4ae7', + 'rsrc/js/core/behavior-line-linker.js' => '1e017314', 'rsrc/js/core/behavior-more.js' => 'a80d0378', 'rsrc/js/core/behavior-object-selector.js' => '77c1f0b0', 'rsrc/js/core/behavior-oncopy.js' => '2926fff2', @@ -634,7 +634,7 @@ 'javelin-behavior-phabricator-gesture-example' => '558829c2', 'javelin-behavior-phabricator-keyboard-pager' => 'a8da01f0', 'javelin-behavior-phabricator-keyboard-shortcuts' => '01fca1f0', - 'javelin-behavior-phabricator-line-linker' => 'febf4ae7', + 'javelin-behavior-phabricator-line-linker' => '1e017314', 'javelin-behavior-phabricator-nav' => '836f966d', 'javelin-behavior-phabricator-notification-example' => '8ce821c5', 'javelin-behavior-phabricator-object-selector' => '77c1f0b0', @@ -998,6 +998,12 @@ 'javelin-workflow', 'javelin-magical-init', ), + '1e017314' => array( + 'javelin-behavior', + 'javelin-stratcom', + 'javelin-dom', + 'javelin-history', + ), '1f6794f6' => array( 'javelin-behavior', 'javelin-stratcom', @@ -2159,12 +2165,6 @@ 'javelin-view-visitor', 'javelin-util', ), - 'febf4ae7' => array( - 'javelin-behavior', - 'javelin-stratcom', - 'javelin-dom', - 'javelin-history', - ), ), 'packages' => array( 'conpherence.pkg.css' => array( diff --git a/webroot/rsrc/js/core/behavior-line-linker.js b/webroot/rsrc/js/core/behavior-line-linker.js --- a/webroot/rsrc/js/core/behavior-line-linker.js +++ b/webroot/rsrc/js/core/behavior-line-linker.js @@ -20,7 +20,22 @@ } function getRowNumber(tr) { - var th = tr.firstChild; + // Starting from the left, find the rightmost "" tag among all + // "" tags at the start of the row. Our goal here is to skip over + // blame information in Diffusion. This could probably be significantly + // more graceful. + var th = null; + for (var ii = 0; ii < tr.childNodes.length; ii++) { + if (JX.DOM.isType(tr.childNodes[ii], 'th')) { + th = tr.childNodes[ii]; + continue; + } + break; + } + + if (!th) { + return null; + } // If the "" tag contains an "" with "data-n" that we're using // to prevent copy/paste of line numbers, use that.