diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 0234603ba9..5241268b0a 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -1513,7 +1513,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-differential-show-all-comments' => array( - 'uri' => '/res/eaa12efc/rsrc/js/application/differential/behavior-show-all-comments.js', + 'uri' => '/res/5a26be1a/rsrc/js/application/differential/behavior-show-all-comments.js', 'type' => 'js', 'requires' => array( diff --git a/webroot/rsrc/js/application/differential/behavior-show-all-comments.js b/webroot/rsrc/js/application/differential/behavior-show-all-comments.js index b896fe326b..cb0a927fda 100644 --- a/webroot/rsrc/js/application/differential/behavior-show-all-comments.js +++ b/webroot/rsrc/js/application/differential/behavior-show-all-comments.js @@ -27,14 +27,18 @@ JX.behavior('differential-show-all-comments', function(config) { // there's an anchor in the URL, since we don't want to link to "#comment-3" // and have it collapsed. - if (window.location.hash) { + function at_comment_hash() { + return window.location.hash && window.location.hash.match(/comment/); + } + + if (at_comment_hash()) { reveal(); } else { JX.Stratcom.listen( 'hashchange', null, function(e) { - if (window.location.hash.match(/comment/) && reveal()) { + if (at_comment_hash() && reveal()) { try { var target = JX.$(window.location.hash.replace(/^#/, '')); window.scrollTo(0, target.offsetTop);