1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-18 10:41:08 +01:00

Allow scrollbars to be dragged outside the window on supporting browsers

Summary: In Safari, Firefox and Chrome drags outside the window will work if we do this. Safari didn't work before, not sure about the other two.

Test Plan: Clicked the scroll handle, then dragged my mouse to the right (outside the window) and down. Page scrolled in Safari, Firefox, and Chrome.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11484
This commit is contained in:
epriestley 2015-01-24 14:18:33 -08:00
parent 25fc168c95
commit 4ceaaf5ea1
2 changed files with 13 additions and 9 deletions

View file

@ -199,7 +199,7 @@ return array(
'rsrc/externals/javelin/lib/Resource.js' => '44959b73', 'rsrc/externals/javelin/lib/Resource.js' => '44959b73',
'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692', 'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692',
'rsrc/externals/javelin/lib/Router.js' => '29274e2b', 'rsrc/externals/javelin/lib/Router.js' => '29274e2b',
'rsrc/externals/javelin/lib/Scrollbar.js' => '65a65098', 'rsrc/externals/javelin/lib/Scrollbar.js' => 'a89e4fc3',
'rsrc/externals/javelin/lib/URI.js' => '6eff08aa', 'rsrc/externals/javelin/lib/URI.js' => '6eff08aa',
'rsrc/externals/javelin/lib/Vector.js' => 'cc1bd0b0', 'rsrc/externals/javelin/lib/Vector.js' => 'cc1bd0b0',
'rsrc/externals/javelin/lib/WebSocket.js' => '3f840822', 'rsrc/externals/javelin/lib/WebSocket.js' => '3f840822',
@ -673,7 +673,7 @@ return array(
'javelin-resource' => '44959b73', 'javelin-resource' => '44959b73',
'javelin-routable' => 'b3e7d692', 'javelin-routable' => 'b3e7d692',
'javelin-router' => '29274e2b', 'javelin-router' => '29274e2b',
'javelin-scrollbar' => '65a65098', 'javelin-scrollbar' => 'a89e4fc3',
'javelin-stratcom' => '8b0ad945', 'javelin-stratcom' => '8b0ad945',
'javelin-tokenizer' => '7644823e', 'javelin-tokenizer' => '7644823e',
'javelin-typeahead' => '70baed2f', 'javelin-typeahead' => '70baed2f',
@ -1244,12 +1244,6 @@ return array(
'javelin-dom', 'javelin-dom',
'javelin-fx', 'javelin-fx',
), ),
'65a65098' => array(
'javelin-install',
'javelin-dom',
'javelin-stratcom',
'javelin-vector',
),
'6882e80a' => array( '6882e80a' => array(
'javelin-dom', 'javelin-dom',
), ),
@ -1556,6 +1550,12 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-dom', 'javelin-dom',
), ),
'a89e4fc3' => array(
'javelin-install',
'javelin-dom',
'javelin-stratcom',
'javelin-vector',
),
'a8d8459d' => array( 'a8d8459d' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',

View file

@ -76,7 +76,11 @@ JX.install('Scrollbar', {
JX.DOM.listen(this._bar, 'mousedown', null, JX.bind(this, this._onjump)); JX.DOM.listen(this._bar, 'mousedown', null, JX.bind(this, this._onjump));
JX.enableDispatch(document.body, 'mouseenter'); JX.enableDispatch(document.body, 'mouseenter');
JX.enableDispatch(document.body, 'mousemove');
// Enabling dispatch for this event on `window` allows us to scroll even
// if the mouse cursor is dragged outside the window in at least some
// browsers (for example, Safari on OSX).
JX.enableDispatch(window, 'mousemove');
JX.DOM.listen(viewport, 'mouseenter', null, JX.bind(this, this._onenter)); JX.DOM.listen(viewport, 'mouseenter', null, JX.bind(this, this._onenter));
JX.DOM.listen(frame, 'scroll', null, JX.bind(this, this._onscroll)); JX.DOM.listen(frame, 'scroll', null, JX.bind(this, this._onscroll));