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:
parent
88fa02147e
commit
e89c6179af
@ -508,7 +508,9 @@ var _Draggable = class _Draggable {
|
|||||||
if (!currentDraggable &&
|
if (!currentDraggable &&
|
||||||
(Math.abs(stageX - this._dragStartX) > threshold ||
|
(Math.abs(stageX - this._dragStartX) > threshold ||
|
||||||
Math.abs(stageY - this._dragStartY) > 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.startDrag(stageX, stageY, event.get_time(), this._touchSequence, event.get_device());
|
||||||
this._updateDragPosition(event);
|
this._updateDragPosition(event);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user