[gnome-shell] iconGrid: Only add one onComplete callback for the animations



commit 6f4c5022ebf9a29584c4347bce9f5c9602b77a34
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Fri Aug 9 00:18:38 2019 +0200

    iconGrid: Only add one onComplete callback for the animations
    
    We only need a callback on the last animated actor, so no need to
    register the callback for all actors.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/678

 js/ui/iconGrid.js | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 1fbf416c5f..e0a1e8bd8a 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -545,12 +545,12 @@ var IconGrid = GObject.registerClass({
                     scale_y: 1,
                     duration: ANIMATION_TIME_IN,
                     mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                    delay,
-                    onComplete: () => {
-                        if (isLastItem)
-                            this._animationDone();
-                    }
+                    delay
                 };
+
+                if (isLastItem)
+                    movementParams.onComplete = this._animationDone.bind(this);
+
                 fadeParams = {
                     opacity: 255,
                     duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,
@@ -571,13 +571,12 @@ var IconGrid = GObject.registerClass({
                     scale_y: scaleY,
                     duration: ANIMATION_TIME_OUT,
                     mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                    delay,
-                    onComplete: () => {
-                        if (isLastItem) {
-                            this._animationDone();
-                        }
-                    }
+                    delay
                 };
+
+                if (isLastItem)
+                    movementParams.onComplete = this._animationDone.bind(this);
+
                 fadeParams = {
                     opacity: 0,
                     duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,


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