[gnome-shell/gnome-3-8] dash: Use a single code path for clearing the drag placeholder



commit ddb682e4fec926eebec300d3ae8a9c6ba700c7bc
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jun 5 14:17:20 2013 +0200

    dash: Use a single code path for clearing the drag placeholder
    
    We currently only keep track of old placeholders when moving past
    the dragged app's current favorite position, as this is the only
    case where we need to worry about jitter. Still, moving it into
    _clearDragPlaceholder() allows us to consolidate code paths, which
    is a good thing ...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684618

 js/ui/dash.js |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 64aed3f..2f78338 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -797,7 +797,12 @@ const Dash = new Lang.Class({
 
     _clearDragPlaceholder: function() {
         if (this._dragPlaceholder) {
+            this._animatingPlaceholdersCount++;
             this._dragPlaceholder.animateOutAndDestroy();
+            this._dragPlaceholder.connect('destroy',
+                Lang.bind(this, function() {
+                    this._animatingPlaceholdersCount--;
+                }));
             this._dragPlaceholder = null;
         }
         this._dragPlaceholderPos = -1;
@@ -834,16 +839,7 @@ const Dash = new Lang.Class({
 
             // Don't allow positioning before or after self
             if (favPos != -1 && (pos == favPos || pos == favPos + 1)) {
-                if (this._dragPlaceholder) {
-                    this._dragPlaceholder.animateOutAndDestroy();
-                    this._animatingPlaceholdersCount++;
-                    this._dragPlaceholder.connect('destroy',
-                        Lang.bind(this, function() {
-                            this._animatingPlaceholdersCount--;
-                        }));
-                }
-                this._dragPlaceholder = null;
-
+                this._clearDragPlaceholder();
                 return DND.DragMotionResult.CONTINUE;
             }
 


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