Page MenuHomePhabricator

D17928.id43122.diff
No OneTemporary

D17928.id43122.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -13,7 +13,7 @@
'core.pkg.js' => '0f87a6eb',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => 'ea471cb0',
- 'differential.pkg.js' => '85c19957',
+ 'differential.pkg.js' => '58457c19',
'diffusion.pkg.css' => 'b93d9b8c',
'diffusion.pkg.js' => '84c8f8fd',
'favicon.ico' => '30672e08',
@@ -391,7 +391,7 @@
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/diff/DiffChangeset.js' => '68758d99',
- 'rsrc/js/application/diff/DiffChangesetList.js' => '842e2676',
+ 'rsrc/js/application/diff/DiffChangesetList.js' => '204e4bfc',
'rsrc/js/application/diff/DiffInline.js' => '1afe9760',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76',
@@ -778,7 +778,7 @@
'phabricator-darkmessage' => 'c48cccdd',
'phabricator-dashboard-css' => 'fe5b1869',
'phabricator-diff-changeset' => '68758d99',
- 'phabricator-diff-changeset-list' => '842e2676',
+ 'phabricator-diff-changeset-list' => '204e4bfc',
'phabricator-diff-inline' => '1afe9760',
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4',
@@ -1066,6 +1066,9 @@
'javelin-install',
'javelin-dom',
),
+ '204e4bfc' => array(
+ 'javelin-install',
+ ),
'21df4ff5' => array(
'javelin-install',
'javelin-workboard-card',
@@ -1532,9 +1535,6 @@
'javelin-install',
'javelin-dom',
),
- '842e2676' => array(
- 'javelin-install',
- ),
'8499b6ab' => array(
'javelin-behavior',
'javelin-dom',
diff --git a/webroot/rsrc/js/application/diff/DiffChangesetList.js b/webroot/rsrc/js/application/diff/DiffChangesetList.js
--- a/webroot/rsrc/js/application/diff/DiffChangesetList.js
+++ b/webroot/rsrc/js/application/diff/DiffChangesetList.js
@@ -65,7 +65,7 @@
var onrangedown = JX.bind(this, this._ifawake, this._onrangedown);
JX.Stratcom.listen(
- 'mousedown',
+ ['touchstart', 'mousedown'],
['differential-changeset', 'tag:th'],
onrangedown);
@@ -75,8 +75,17 @@
['differential-changeset', 'tag:th'],
onrangemove);
+ var onrangetouchmove = JX.bind(this, this._ifawake, this._onrangetouchmove);
+ JX.Stratcom.listen(
+ 'touchmove',
+ null,
+ onrangetouchmove);
+
var onrangeup = JX.bind(this, this._ifawake, this._onrangeup);
- JX.Stratcom.listen('mouseup', null, onrangeup);
+ JX.Stratcom.listen(
+ ['touchend', 'mouseup'],
+ null,
+ onrangeup);
},
properties: {
@@ -1088,11 +1097,9 @@
},
_onrangedown: function(e) {
- if (!e.isNormalMouseEvent()) {
- return;
- }
-
- if (e.getIsTouchEvent()) {
+ // NOTE: We're allowing touch events through, including "touchstart". We
+ // need to kill the "touchstart" event so the page doesn't scroll.
+ if (e.isRightButton()) {
return;
}
@@ -1120,8 +1127,13 @@
return;
}
+ var is_out = (e.getType() == 'mouseout');
var target = e.getTarget();
+ this._updateRange(target, is_out);
+ },
+
+ _updateRange: function(target, is_out) {
// Don't update the range if this "<th />" doesn't correspond to a line
// number. For instance, this may be a dead line number, like the empty
// line numbers on the left hand side of a newly added file.
@@ -1154,7 +1166,6 @@
}
}
- var is_out = (e.getType() == 'mouseout');
if (is_out) {
if (this._rangeActive) {
// If we're dragging a range, just leave the state as it is. This
@@ -1177,6 +1188,31 @@
this._setHoverRange(this._rangeOrigin, this._rangeTarget);
},
+ _onrangetouchmove: function(e) {
+ if (!this._rangeActive) {
+ return;
+ }
+
+ // NOTE: The target of a "touchmove" event is bogus. Use dark magic to
+ // identify the actual target. Some day, this might move into the core
+ // libraries. If this doesn't work, just bail.
+
+ var target;
+ try {
+ var raw_event = e.getRawEvent();
+ var touch = raw_event.touches[0];
+ target = document.elementFromPoint(touch.clientX, touch.clientY);
+ } catch (ex) {
+ return;
+ }
+
+ if (!JX.DOM.isType(target, 'th')) {
+ return;
+ }
+
+ this._updateRange(target, false);
+ },
+
_onrangeup: function(e) {
if (!this._rangeActive) {
return;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 9:22 AM (1 h, 53 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6785549
Default Alt Text
D17928.id43122.diff (4 KB)

Event Timeline