dnd: Factor out calculation into a variable

Another trivial cleanup. This is in preparation for next commit, that
will expand on this if clause, and will make it a bit more complicated.
Using a variable here makes it easier to read.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1866>
This commit is contained in:
Georges Basile Stavracas Neto 2021-05-30 21:32:54 -03:00
parent 88fa02147e
commit e89c6179af

View File

@ -508,7 +508,9 @@ var _Draggable = class _Draggable {
if (!currentDraggable &&
(Math.abs(stageX - this._dragStartX) > threshold ||
Math.abs(stageY - this._dragStartY) > threshold)) {
if ((event.get_time() - this._dragStartTime) > this._dragTimeoutThreshold) {
const ellapsedTime = event.get_time() - this._dragStartTime;
if (ellapsedTime > this._dragTimeoutThreshold) {
this.startDrag(stageX, stageY, event.get_time(), this._touchSequence, event.get_device());
this._updateDragPosition(event);
} else {