[gnome-shell] viewSelector: notify on active page changes
- From: Cosimo Cecchi <cosimoc src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-shell] viewSelector: notify on active page changes
 
- Date: Thu, 14 Feb 2013 23:18:56 +0000 (UTC)
 
commit f2edcb9bdf77110835f4e5c22a654d6ecdff402e
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jan 24 16:35:11 2013 -0500
    viewSelector: notify on active page changes
    
    In order to do this, we also need to move the assignment of
    this._activePage from the animation onComplete callback to the function
    itself.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682050
 js/ui/viewSelector.js |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index c925cfd..e1d2ef5 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -201,24 +201,27 @@ const ViewSelector = new Lang.Class({
     },
 
     _showPage: function(page) {
-        if(page == this._activePage)
+        if (page == this._activePage)
             return;
 
-        if(this._activePage) {
-            Tweener.addTween(this._activePage,
+        let oldPage = this._activePage;
+        if (oldPage) {
+            Tweener.addTween(oldPage,
                              { opacity: 0,
                                time: 0.1,
                                transition: 'easeOutQuad',
                                onComplete: Lang.bind(this,
                                    function() {
-                                       this._activePage.hide();
-                                       this._activePage = page;
+                                       oldPage.hide();
                                    })
                              });
         }
 
-        page.show();
-        Tweener.addTween(page,
+        this._activePage = page;
+        this._activePage.show();
+        this.emit('page-changed');
+
+        Tweener.addTween(this._activePage,
                          { opacity: 255,
                            time: 0.1,
                            transition: 'easeOutQuad'
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]