1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-12 16:46:15 +01:00

(stable) Hide the Differential scroll objective list on trackpad systems

Summary:
Ref T12733. In the longer run I'd like to just push this out from the edge, but that currently gets us into trouble since we start bumping into content. On my system, the trackpad scrollbar also expands in size when moused over, so the minimum number of pixels we need to push it out is approximatley 15px. This hits body content and the persistent chat.

For now, just disable this element on trackpad systems.

Test Plan:
Disconnected all USB peripherals, quit and relaunched Safari, saw no objective list.

Reconnected mouse, relaunched Safari, saw objective list.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12733

Differential Revision: https://secure.phabricator.com/D17974
This commit is contained in:
epriestley 2017-05-20 04:10:32 -07:00
parent 7ee20f573d
commit 1495c80e62
4 changed files with 39 additions and 27 deletions

View file

@ -10,10 +10,10 @@ return array(
'conpherence.pkg.css' => 'ff161f2d', 'conpherence.pkg.css' => 'ff161f2d',
'conpherence.pkg.js' => 'b5b51108', 'conpherence.pkg.js' => 'b5b51108',
'core.pkg.css' => '5ffe8b79', 'core.pkg.css' => '5ffe8b79',
'core.pkg.js' => 'e822b496', 'core.pkg.js' => '6b2da600',
'darkconsole.pkg.js' => '1f9a31bc', 'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '4d7dd14e', 'differential.pkg.css' => 'bf87589e',
'differential.pkg.js' => '0dfe037d', 'differential.pkg.js' => 'ee4f14c5',
'diffusion.pkg.css' => 'b93d9b8c', 'diffusion.pkg.css' => 'b93d9b8c',
'diffusion.pkg.js' => '84c8f8fd', 'diffusion.pkg.js' => '84c8f8fd',
'favicon.ico' => '30672e08', 'favicon.ico' => '30672e08',
@ -64,7 +64,7 @@ return array(
'rsrc/css/application/dashboard/dashboard.css' => 'fe5b1869', 'rsrc/css/application/dashboard/dashboard.css' => 'fe5b1869',
'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a', 'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a',
'rsrc/css/application/differential/add-comment.css' => 'c47f8c40', 'rsrc/css/application/differential/add-comment.css' => 'c47f8c40',
'rsrc/css/application/differential/changeset-view.css' => '54774a28', 'rsrc/css/application/differential/changeset-view.css' => 'fa476ec0',
'rsrc/css/application/differential/core.css' => '5b7b8ff4', 'rsrc/css/application/differential/core.css' => '5b7b8ff4',
'rsrc/css/application/differential/phui-inline-comment.css' => 'ffd1a542', 'rsrc/css/application/differential/phui-inline-comment.css' => 'ffd1a542',
'rsrc/css/application/differential/revision-comment.css' => '14b8565a', 'rsrc/css/application/differential/revision-comment.css' => '14b8565a',
@ -247,7 +247,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' => '087e919c', 'rsrc/externals/javelin/lib/Scrollbar.js' => '9065f639',
'rsrc/externals/javelin/lib/Sound.js' => '949c0fe5', 'rsrc/externals/javelin/lib/Sound.js' => '949c0fe5',
'rsrc/externals/javelin/lib/URI.js' => 'c989ade3', 'rsrc/externals/javelin/lib/URI.js' => 'c989ade3',
'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8', 'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8',
@ -394,7 +394,7 @@ return array(
'rsrc/js/application/diff/DiffChangesetList.js' => 'a716ca27', 'rsrc/js/application/diff/DiffChangesetList.js' => 'a716ca27',
'rsrc/js/application/diff/DiffInline.js' => '77e14b60', 'rsrc/js/application/diff/DiffInline.js' => '77e14b60',
'rsrc/js/application/diff/ScrollObjective.js' => '0eee7a00', 'rsrc/js/application/diff/ScrollObjective.js' => '0eee7a00',
'rsrc/js/application/diff/ScrollObjectiveList.js' => '1ca4d9db', 'rsrc/js/application/diff/ScrollObjectiveList.js' => '085dd101',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07',
'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1',
@ -567,7 +567,7 @@ return array(
'conpherence-thread-manager' => '4d863052', 'conpherence-thread-manager' => '4d863052',
'conpherence-transaction-css' => '85129c68', 'conpherence-transaction-css' => '85129c68',
'd3' => 'a11a5ff2', 'd3' => 'a11a5ff2',
'differential-changeset-view-css' => '54774a28', 'differential-changeset-view-css' => 'fa476ec0',
'differential-core-view-css' => '5b7b8ff4', 'differential-core-view-css' => '5b7b8ff4',
'differential-revision-add-comment-css' => 'c47f8c40', 'differential-revision-add-comment-css' => 'c47f8c40',
'differential-revision-comment-css' => '14b8565a', 'differential-revision-comment-css' => '14b8565a',
@ -732,7 +732,7 @@ return array(
'javelin-resource' => '44959b73', 'javelin-resource' => '44959b73',
'javelin-routable' => 'b3e7d692', 'javelin-routable' => 'b3e7d692',
'javelin-router' => '29274e2b', 'javelin-router' => '29274e2b',
'javelin-scrollbar' => '087e919c', 'javelin-scrollbar' => '9065f639',
'javelin-sound' => '949c0fe5', 'javelin-sound' => '949c0fe5',
'javelin-stratcom' => '6ad39b6f', 'javelin-stratcom' => '6ad39b6f',
'javelin-tokenizer' => '8d3bc1b2', 'javelin-tokenizer' => '8d3bc1b2',
@ -800,7 +800,7 @@ return array(
'phabricator-prefab' => 'c5af80a2', 'phabricator-prefab' => 'c5af80a2',
'phabricator-remarkup-css' => 'd1a5e11e', 'phabricator-remarkup-css' => 'd1a5e11e',
'phabricator-scroll-objective' => '0eee7a00', 'phabricator-scroll-objective' => '0eee7a00',
'phabricator-scroll-objective-list' => '1ca4d9db', 'phabricator-scroll-objective-list' => '085dd101',
'phabricator-search-results-css' => 'f87d23ad', 'phabricator-search-results-css' => 'f87d23ad',
'phabricator-shaped-request' => '7cbe244b', 'phabricator-shaped-request' => '7cbe244b',
'phabricator-slowvote-css' => 'a94b7230', 'phabricator-slowvote-css' => 'a94b7230',
@ -956,11 +956,14 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-util', 'javelin-util',
), ),
'087e919c' => array( '085dd101' => array(
'javelin-install',
'javelin-dom', 'javelin-dom',
'javelin-util',
'javelin-stratcom', 'javelin-stratcom',
'javelin-vector', 'javelin-install',
'javelin-workflow',
'javelin-scrollbar',
'phabricator-scroll-objective',
), ),
'08f4ccc3' => array( '08f4ccc3' => array(
'phui-oi-list-view-css', 'phui-oi-list-view-css',
@ -1034,14 +1037,6 @@ return array(
'javelin-request', 'javelin-request',
'javelin-uri', 'javelin-uri',
), ),
'1ca4d9db' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-workflow',
'phabricator-scroll-objective',
),
'1de8bf63' => array( '1de8bf63' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@ -1324,9 +1319,6 @@ return array(
'5294060f' => array( '5294060f' => array(
'phui-theme-css', 'phui-theme-css',
), ),
'54774a28' => array(
'phui-inline-comment-view-css',
),
'54b612ba' => array( '54b612ba' => array(
'javelin-color', 'javelin-color',
'javelin-install', 'javelin-install',
@ -1611,6 +1603,12 @@ return array(
'javelin-dom', 'javelin-dom',
'javelin-request', 'javelin-request',
), ),
'9065f639' => array(
'javelin-install',
'javelin-dom',
'javelin-stratcom',
'javelin-vector',
),
'92b9ec77' => array( '92b9ec77' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-stratcom', 'javelin-stratcom',
@ -2208,6 +2206,9 @@ return array(
'javelin-install', 'javelin-install',
'javelin-dom', 'javelin-dom',
), ),
'fa476ec0' => array(
'phui-inline-comment-view-css',
),
'fbe497e7' => array( 'fbe497e7' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-util', 'javelin-util',

View file

@ -423,6 +423,11 @@ tr.differential-inline-loading {
overflow: hidden; overflow: hidden;
} }
.scroll-objective-list.has-aesthetic-scrollbar {
/* For now, hide this element on systems with aesthetic scrollbars. */
display: none;
}
.scroll-objective { .scroll-objective {
display: block; display: block;
position: absolute; position: absolute;

View file

@ -34,7 +34,7 @@ JX.install('Scrollbar', {
// width. If it doesn't, we're already in an environment with an aesthetic // width. If it doesn't, we're already in an environment with an aesthetic
// scrollbar (like Safari on OSX with no mouse connected, or an iPhone) // scrollbar (like Safari on OSX with no mouse connected, or an iPhone)
// and we don't need to do anything. // and we don't need to do anything.
if (JX.Scrollbar._getScrollbarControlWidth() === 0) { if (JX.Scrollbar.getScrollbarControlWidth() === 0) {
return; return;
} }
@ -104,7 +104,7 @@ JX.install('Scrollbar', {
/** /**
* Compute the width of the browser's scrollbar control, in pixels. * Compute the width of the browser's scrollbar control, in pixels.
*/ */
_getScrollbarControlWidth: function() { getScrollbarControlWidth: function() {
var self = JX.Scrollbar; var self = JX.Scrollbar;
if (self._controlWidth === null) { if (self._controlWidth === null) {
@ -140,7 +140,7 @@ JX.install('Scrollbar', {
// If this browser and OS don't render a real scrollbar control, we // If this browser and OS don't render a real scrollbar control, we
// need to leave a margin. Generally, this is OSX with no mouse attached. // need to leave a margin. Generally, this is OSX with no mouse attached.
if (self._getScrollbarControlWidth() === 0) { if (self.getScrollbarControlWidth() === 0) {
return 12; return 12;
} }
@ -357,7 +357,7 @@ JX.install('Scrollbar', {
*/ */
_resizeViewport: function() { _resizeViewport: function() {
var fdim = JX.Vector.getDim(this._frame); var fdim = JX.Vector.getDim(this._frame);
fdim.x += JX.Scrollbar._getScrollbarControlWidth(); fdim.x += JX.Scrollbar.getScrollbarControlWidth();
fdim.setDim(this._viewport); fdim.setDim(this._viewport);
}, },

View file

@ -5,6 +5,7 @@
* javelin-stratcom * javelin-stratcom
* javelin-install * javelin-install
* javelin-workflow * javelin-workflow
* javelin-scrollbar
* phabricator-scroll-objective * phabricator-scroll-objective
* @javelin * @javelin
*/ */
@ -81,6 +82,11 @@ JX.install('ScrollObjectiveList', {
document.body.appendChild(node); document.body.appendChild(node);
// If we're on OSX without a mouse or some other system with zero-width
// trackpad-style scrollbars, adjust the display appropriately.
var aesthetic = (JX.Scrollbar.getScrollbarControlWidth() === 0);
JX.DOM.alterClass(node, 'has-aesthetic-scrollbar', aesthetic);
var d = JX.Vector.getDocument(); var d = JX.Vector.getDocument();
var list_dimensions = JX.Vector.getDim(node); var list_dimensions = JX.Vector.getDim(node);