gnome-shell r154 - trunk/js/ui



Author: walters
Date: Tue Jan 20 16:13:41 2009
New Revision: 154
URL: http://svn.gnome.org/viewvc/gnome-shell?rev=154&view=rev

Log:
Fix closing of loop variable which caused error messages

Can't close over loop variables in that way; need to define an explicit var.

Also fix case where no title is defined yet when attempting to adjust.

Modified:
   trunk/js/ui/workspaces.js

Modified: trunk/js/ui/workspaces.js
==============================================================================
--- trunk/js/ui/workspaces.js	(original)
+++ trunk/js/ui/workspaces.js	Tue Jan 20 16:13:41 2009
@@ -262,7 +262,8 @@
             let newY = this.gridY + (this._windows[i].y - this._desktop.y) * rescale;
             let newWindowScale = this._windows[i].scale_x * rescale;
 
-            Tweener.addTween(this._windows[i],
+            let window = this._windows[i];
+            Tweener.addTween(window,
                              { x: newX,
                                y: newY,
                                scale_x: newWindowScale,
@@ -270,7 +271,7 @@
                                time: Overlay.ANIMATION_TIME,
                                transition: "easeOutQuad",
                                onComplete: function () {
-                                   me._adjustCloneTitle(me._windows[i]);
+                                   me._adjustCloneTitle(window);
                                }
                              });
 
@@ -491,7 +492,9 @@
 
     _adjustCloneTitle : function (clone) {
         let transformed = clone.get_transformed_size();
-        let title = clone.cloneTitle;    
+        let title = clone.cloneTitle;
+        if (!title)
+            return;    
         title.width = Math.min(title.fullWidth, transformed[0]);
         let xoff = (transformed[0] - title.width)/2;
         title.set_position(clone.x+xoff, clone.y);



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