1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Remove an old Differential selection behavior

Summary:
Ref T12822. Ref PHI878. This is some leftover code from the old selection behavior that prevented visual selection of the left side of a diff if the user clicked on the right -- basically, a much simpler attack on what ultimately landed in D20191.

I think the change from `th` to `td` "broke" it so it didn't interfere with the other behavior, which is why I didn't have to remove it earlier. It's no longer necessary, in any case.

Test Plan: Grepped for behavior name, selected stuff on both sides of a diff.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T12822

Differential Revision: https://secure.phabricator.com/D20196
This commit is contained in:
epriestley 2019-02-19 20:52:29 -08:00
parent c10b283b92
commit a33409991c
5 changed files with 4 additions and 56 deletions

View file

@ -11,8 +11,8 @@ return array(
'conpherence.pkg.js' => '020aebcf',
'core.pkg.css' => 'e3c1a8f2',
'core.pkg.js' => '2cda17a4',
'differential.pkg.css' => '9f215e54',
'differential.pkg.js' => '53f8d00c',
'differential.pkg.css' => '97e13037',
'differential.pkg.js' => '67e02996',
'diffusion.pkg.css' => '42c75c37',
'diffusion.pkg.js' => '91192d85',
'maniphest.pkg.css' => '35995d6d',
@ -62,7 +62,7 @@ return array(
'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d',
'rsrc/css/application/differential/add-comment.css' => '7e5900d9',
'rsrc/css/application/differential/changeset-view.css' => 'de570228',
'rsrc/css/application/differential/core.css' => 'bdb93065',
'rsrc/css/application/differential/core.css' => '7300a73e',
'rsrc/css/application/differential/phui-inline-comment.css' => '48acce5b',
'rsrc/css/application/differential/revision-comment.css' => '7dbc8d1d',
'rsrc/css/application/differential/revision-history.css' => '8aa3eac5',
@ -380,7 +380,6 @@ return array(
'rsrc/js/application/diff/behavior-preview-link.js' => 'f51e9c17',
'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd',
'rsrc/js/application/differential/behavior-populate.js' => 'dfa1d313',
'rsrc/js/application/differential/behavior-user-select.js' => 'e18685c0',
'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => '94243d89',
'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'b7b73831',
'rsrc/js/application/diffusion/behavior-commit-branches.js' => '4b671572',
@ -542,7 +541,7 @@ return array(
'conpherence-transaction-css' => '3a3f5e7e',
'd3' => 'd67475f5',
'differential-changeset-view-css' => 'de570228',
'differential-core-view-css' => 'bdb93065',
'differential-core-view-css' => '7300a73e',
'differential-revision-add-comment-css' => '7e5900d9',
'differential-revision-comment-css' => '7dbc8d1d',
'differential-revision-history-css' => '8aa3eac5',
@ -596,7 +595,6 @@ return array(
'javelin-behavior-diff-preview-link' => 'f51e9c17',
'javelin-behavior-differential-diff-radios' => '925fe8cd',
'javelin-behavior-differential-populate' => 'dfa1d313',
'javelin-behavior-differential-user-select' => 'e18685c0',
'javelin-behavior-diffusion-commit-branches' => '4b671572',
'javelin-behavior-diffusion-commit-graph' => '1c88f154',
'javelin-behavior-diffusion-locate-file' => '87428eb2',
@ -2030,11 +2028,6 @@ return array(
'javelin-dom',
'javelin-history',
),
'e18685c0' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
),
'e562708c' => array(
'javelin-install',
),
@ -2339,7 +2332,6 @@ return array(
'javelin-behavior-aphront-drag-and-drop-textarea',
'javelin-behavior-phabricator-object-selector',
'javelin-behavior-repository-crossreference',
'javelin-behavior-differential-user-select',
'javelin-behavior-aphront-more',
'phabricator-diff-inline',
'phabricator-diff-changeset',

View file

@ -199,7 +199,6 @@ return array(
'javelin-behavior-phabricator-object-selector',
'javelin-behavior-repository-crossreference',
'javelin-behavior-differential-user-select',
'javelin-behavior-aphront-more',
'phabricator-diff-inline',

View file

@ -621,8 +621,6 @@ final class DifferentialRevisionViewController
->build($changesets);
}
Javelin::initBehavior('differential-user-select');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setSubheader($subheader)

View file

@ -16,14 +16,6 @@
margin-bottom: 8px;
}
.differential-unselectable tr td:nth-of-type(1) {
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.differential-content-hidden {
margin: 0 0 24px 0;
}

View file

@ -1,33 +0,0 @@
/**
* @provides javelin-behavior-differential-user-select
* @requires javelin-behavior
* javelin-dom
* javelin-stratcom
*/
JX.behavior('differential-user-select', function() {
var unselectable;
function isOnRight(node) {
return node.previousSibling &&
node.parentNode.firstChild != node.previousSibling;
}
JX.Stratcom.listen(
'mousedown',
null,
function(e) {
var key = 'differential-unselectable';
if (unselectable) {
JX.DOM.alterClass(unselectable, key, false);
}
var diff = e.getNode('differential-diff');
var td = e.getNode('tag:td');
if (diff && td && isOnRight(td)) {
unselectable = diff;
JX.DOM.alterClass(diff, key, true);
}
});
});