From 6f4c5022ebf9a29584c4347bce9f5c9602b77a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 9 Aug 2019 00:18:38 +0200 Subject: [PATCH] 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 1fbf416c5..e0a1e8bd8 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,