[gnome-documents/wip/cosimoc/view-rework: 26/42] embed: use widget reference directly



commit 82506fe2278740864540b90f6844ef7cd35966c4
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Jul 31 21:25:18 2016 -0700

    embed: use widget reference directly
    
    This will be useful in a later commit.

 src/embed.js |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index e8c072d..3443d5a 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -393,17 +393,17 @@ const Embed = new Lang.Class({
                              oldMode != WindowMode.WindowMode.DOCUMENTS &&
                              oldMode != WindowMode.WindowMode.SEARCH);
 
-        let visibleChildName;
+        let visibleChild;
 
         switch (newMode) {
         case WindowMode.WindowMode.COLLECTIONS:
-            visibleChildName = 'collections';
+            visibleChild = this._collections;
             break;
         case WindowMode.WindowMode.DOCUMENTS:
-            visibleChildName = 'documents';
+            visibleChild = this._documents;
             break;
         case WindowMode.WindowMode.SEARCH:
-            visibleChildName = 'search';
+            visibleChild = this._search;
             break;
         default:
             throw(new Error('Not handled'));
@@ -422,7 +422,7 @@ const Embed = new Lang.Class({
         }
 
         this._spinner.stop();
-        this._stack.set_visible_child_name(visibleChildName);
+        this._stack.set_visible_child(visibleChild);
     },
 
     _prepareForPreview: function(constructor) {


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