@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 window-exiting drags and drag-and-hold behaviors in JX.Scrollbar

Summary:
Fixes two issues:

- In Firefox, dragging outside the window and releasing the mouse button would miss the `mouseup` event. This would leave the bar dragging, even though the user had released the mouse button.
- In all browsers, dragging the handle and then holding your cursor in one place for more than a second would hide the handle. Instead, never hide the handle during a drag.

Test Plan:
- In Firefox, dragged handle right (outside of window) and released mouse button. Waved cursor over window; no more "sticky" scroll.
- In FF/Chrome/Safari, dragged handle and held cursor in same position for several seconds. No more handle hide.
- Waved cursor over window and made sure normal hiding still works.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

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

+27 -14
+10 -10
resources/celerity/map.php
··· 166 166 'rsrc/externals/javelin/core/__tests__/install.js' => 'c432ee85', 167 167 'rsrc/externals/javelin/core/__tests__/stratcom.js' => '88bf7313', 168 168 'rsrc/externals/javelin/core/__tests__/util.js' => 'e251703d', 169 - 'rsrc/externals/javelin/core/init.js' => '8c4e8f8b', 169 + 'rsrc/externals/javelin/core/init.js' => '4df97779', 170 170 'rsrc/externals/javelin/core/init_node.js' => 'c234aded', 171 171 'rsrc/externals/javelin/core/install.js' => '05270951', 172 172 'rsrc/externals/javelin/core/util.js' => '93cc50d6', ··· 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' => '8ebeb833', 202 + 'rsrc/externals/javelin/lib/Scrollbar.js' => 'ad2c4a94', 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', ··· 663 663 'javelin-install' => '05270951', 664 664 'javelin-json' => '69adf288', 665 665 'javelin-leader' => '331b1611', 666 - 'javelin-magical-init' => '8c4e8f8b', 666 + 'javelin-magical-init' => '4df97779', 667 667 'javelin-mask' => '8a41885b', 668 668 'javelin-reactor' => '2b8de964', 669 669 'javelin-reactor-dom' => 'c90a04fc', ··· 673 673 'javelin-resource' => '44959b73', 674 674 'javelin-routable' => 'b3e7d692', 675 675 'javelin-router' => '29274e2b', 676 - 'javelin-scrollbar' => '8ebeb833', 676 + 'javelin-scrollbar' => 'ad2c4a94', 677 677 'javelin-stratcom' => '8b0ad945', 678 678 'javelin-tokenizer' => '7644823e', 679 679 'javelin-typeahead' => '70baed2f', ··· 1468 1468 'javelin-stratcom', 1469 1469 'javelin-behavior', 1470 1470 ), 1471 - '8ebeb833' => array( 1472 - 'javelin-install', 1473 - 'javelin-dom', 1474 - 'javelin-stratcom', 1475 - 'javelin-vector', 1476 - ), 1477 1471 '8ef9ab58' => array( 1478 1472 'javelin-behavior', 1479 1473 'javelin-dom', ··· 1581 1575 'javelin-dom', 1582 1576 'javelin-util', 1583 1577 'phabricator-prefab', 1578 + ), 1579 + 'ad2c4a94' => array( 1580 + 'javelin-install', 1581 + 'javelin-dom', 1582 + 'javelin-stratcom', 1583 + 'javelin-vector', 1584 1584 ), 1585 1585 'ad7a69ca' => array( 1586 1586 'javelin-install',
+8 -4
webroot/rsrc/externals/javelin/core/init.js
··· 132 132 'mousedown', 133 133 'mouseover', 134 134 'mouseout', 135 - 'mouseup', 136 135 'keyup', 137 136 'keydown', 138 137 'input', ··· 172 171 JX.enableDispatch(root, document_events[ii]); 173 172 } 174 173 175 - // In particular, we're interested in capturing window focus/blur here so 176 - // long polls can abort when the window is not focused. 174 + // In particular, we're interested in capturing window focus/blur here so 175 + // long polls can abort when the window is not focused. 177 176 var window_events = [ 178 177 ('onpagehide' in window) ? 'pagehide' : 'unload', 179 178 'resize', ··· 181 180 'focus', 182 181 'blur', 183 182 'popstate', 184 - 'hashchange' 183 + 'hashchange', 184 + 185 + // In Firefox, if the user clicks in the window then drags the cursor 186 + // outside of the window and releases the mouse button, we don't get this 187 + // event unless we listen for it as a window event. 188 + 'mouseup' 185 189 ]; 186 190 187 191 if (window.localStorage) {
+9
webroot/rsrc/externals/javelin/lib/Scrollbar.js
··· 238 238 */ 239 239 _ondrop: function() { 240 240 this._dragOrigin = null; 241 + 242 + // Reset the timer to hide the bar. 243 + this._showBar(); 241 244 }, 242 245 243 246 ··· 293 296 * Hide the scrollbar. 294 297 */ 295 298 _hideBar: function() { 299 + if (this._dragOrigin !== null) { 300 + // If we're currently dragging the handle, we never want to hide 301 + // it. 302 + return; 303 + } 304 + 296 305 JX.DOM.alterClass(this._handle, 'jx-scrollbar-visible', false); 297 306 this._clearTimeout(); 298 307 },