diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 01d2ec7b0b..68af3f37ef 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -199,7 +199,7 @@ return array( 'rsrc/externals/javelin/lib/Resource.js' => '44959b73', 'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692', 'rsrc/externals/javelin/lib/Router.js' => '29274e2b', - 'rsrc/externals/javelin/lib/Scrollbar.js' => 'ef2ec0c6', + 'rsrc/externals/javelin/lib/Scrollbar.js' => '5b2f5a08', 'rsrc/externals/javelin/lib/URI.js' => '6eff08aa', 'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8', 'rsrc/externals/javelin/lib/WebSocket.js' => '3f840822', @@ -672,7 +672,7 @@ return array( 'javelin-resource' => '44959b73', 'javelin-routable' => 'b3e7d692', 'javelin-router' => '29274e2b', - 'javelin-scrollbar' => 'ef2ec0c6', + 'javelin-scrollbar' => '5b2f5a08', 'javelin-stratcom' => '6c53634d', 'javelin-tokenizer' => '7644823e', 'javelin-typeahead' => '70baed2f', @@ -1186,6 +1186,12 @@ return array( 'javelin-vector', 'javelin-dom', ), + '5b2f5a08' => array( + 'javelin-install', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-vector', + ), '5bc2cb21' => array( 'javelin-behavior', 'javelin-stratcom', @@ -1863,12 +1869,6 @@ return array( 'phabricator-phtize', 'javelin-dom', ), - 'ef2ec0c6' => array( - 'javelin-install', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-vector', - ), 'efe49472' => array( 'javelin-install', 'javelin-util', diff --git a/webroot/rsrc/externals/javelin/lib/Scrollbar.js b/webroot/rsrc/externals/javelin/lib/Scrollbar.js index 37d6c166fb..2242e048b6 100644 --- a/webroot/rsrc/externals/javelin/lib/Scrollbar.js +++ b/webroot/rsrc/externals/javelin/lib/Scrollbar.js @@ -308,22 +308,30 @@ JX.install('Scrollbar', { * Figure out the correct size and offset of the scrollbar handle. */ _resizeBar: function() { + // We're hiding and showing the bar itself, not just the handle, because + // pages that contain other panels may have scrollbars underneath the + // bar. If we don't hide the bar, it ends up eating clicks targeting + // these panels. + + // Because the bar may be hidden, we can't measure it. Measure the + // viewport instead. + var cdim = JX.Vector.getDim(this._content); var spos = JX.Vector.getAggregateScrollForNode(this._viewport); - var bdim = JX.Vector.getDim(this._bar); + var vdim = JX.Vector.getDim(this._viewport); - var ratio = bdim.y / cdim.y; + var ratio = vdim.y / cdim.y; var offset = Math.round(ratio * spos.y) + 2; - var size = Math.floor(ratio * (bdim.y - 2)) - 2; + var size = Math.floor(ratio * (vdim.y - 2)) - 2; if (size < cdim.y) { this._handle.style.top = offset + 'px'; this._handle.style.height = size + 'px'; - JX.DOM.show(this._handle); + JX.DOM.show(this._bar); } else { - JX.DOM.hide(this._handle); + JX.DOM.hide(this._bar); } },