[gnome-shell] dnd: Factor out calculation into a variable



commit e89c6179af0f4f983b57fefe0d5e3d5bcdbc2dbc
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun May 30 21:32:54 2021 -0300

    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>

 js/ui/dnd.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 252ebb85c3..4fbe1acc78 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -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 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]