@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix an issue with dragging the scrollbar handle from a noninitial position

Summary:
See <rPc40bc0c8bf75#4050>. Repro steps:

- Scroll partway down the page.
- Click and drag the scroll handle.

Prior to this diff, the handle incorrectly jumps back to the top of the page. This is because we didn't store the handle's original position. (In testing, I always dragged from near the top of the page, and I don't normally drag scrollbars, so I didn't notice this.)

Test Plan: Clicking and dragging a partially scrolled handle now works correctly.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11483

+16 -10
+8 -8
resources/celerity/map.php
··· 199 199 'rsrc/externals/javelin/lib/Resource.js' => '44959b73', 200 200 'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692', 201 201 'rsrc/externals/javelin/lib/Router.js' => '29274e2b', 202 - 'rsrc/externals/javelin/lib/Scrollbar.js' => 'e8e4c640', 202 + 'rsrc/externals/javelin/lib/Scrollbar.js' => '65a65098', 203 203 'rsrc/externals/javelin/lib/URI.js' => '6eff08aa', 204 204 'rsrc/externals/javelin/lib/Vector.js' => 'cc1bd0b0', 205 205 'rsrc/externals/javelin/lib/WebSocket.js' => '3f840822', ··· 673 673 'javelin-resource' => '44959b73', 674 674 'javelin-routable' => 'b3e7d692', 675 675 'javelin-router' => '29274e2b', 676 - 'javelin-scrollbar' => 'e8e4c640', 676 + 'javelin-scrollbar' => '65a65098', 677 677 'javelin-stratcom' => '8b0ad945', 678 678 'javelin-tokenizer' => '7644823e', 679 679 'javelin-typeahead' => '70baed2f', ··· 1244 1244 'javelin-dom', 1245 1245 'javelin-fx', 1246 1246 ), 1247 + '65a65098' => array( 1248 + 'javelin-install', 1249 + 'javelin-dom', 1250 + 'javelin-stratcom', 1251 + 'javelin-vector', 1252 + ), 1247 1253 '6882e80a' => array( 1248 1254 'javelin-dom', 1249 1255 ), ··· 1844 1850 'javelin-mask', 1845 1851 'javelin-behavior-device', 1846 1852 'phabricator-keyboard-shortcut', 1847 - ), 1848 - 'e8e4c640' => array( 1849 - 'javelin-install', 1850 - 'javelin-dom', 1851 - 'javelin-stratcom', 1852 - 'javelin-vector', 1853 1853 ), 1854 1854 'e9581f08' => array( 1855 1855 'javelin-behavior',
+8 -2
webroot/rsrc/externals/javelin/lib/Scrollbar.js
··· 127 127 128 128 _timeout: null, 129 129 _dragOrigin: null, 130 + _scrollOrigin: null, 130 131 131 132 132 133 /** ··· 181 182 */ 182 183 _ondrag: function(e) { 183 184 e.kill(); 185 + 186 + // Store the position where the drag started. 184 187 this._dragOrigin = JX.$V(e).y; 188 + 189 + // Store the original position of the handle. 190 + this._scrollOrigin = this._viewport.scrollTop; 185 191 }, 186 192 187 193 ··· 195 201 196 202 var offset = (JX.$V(e).y - this._dragOrigin); 197 203 var ratio = offset / JX.Vector.getDim(this._bar).y; 198 - var target = ratio * JX.Vector.getDim(this._content).y; 204 + var adjust = ratio * JX.Vector.getDim(this._content).y; 199 205 200 - this._viewport.scrollTop = target; 206 + this._viewport.scrollTop = this._scrollOrigin + adjust; 201 207 }, 202 208 203 209