[the-board] [ui] Add Toolbar's ability to load state from active thing



commit bc4064a8e4bb9fc196268eb9c7eef716f0aa8ba8
Author: Lucas Rocha <lucasr gnome org>
Date:   Tue Nov 16 23:39:44 2010 +0000

    [ui] Add Toolbar's ability to load state from active thing

 src/js/ui/mainWindow.js |    8 ++++++++
 src/js/ui/toolbar.js    |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 771991e..0f196b6 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -421,6 +421,14 @@ MainWindow.prototype = {
         let newThingToolbar = this._createThingToolbar();
 
         this._thingToolbar = newThingToolbar;
+
+        if (this._currentPage.activeThing && this._thingToolbar) {
+            let activeThing = this._currentPage.activeThing;
+            let state = activeThing.onGetState();
+
+            this._thingToolbar.loadState(state);
+        }
+
         this._updateActiveToolbar();
     },
 
diff --git a/src/js/ui/toolbar.js b/src/js/ui/toolbar.js
index 307aa43..63b1030 100644
--- a/src/js/ui/toolbar.js
+++ b/src/js/ui/toolbar.js
@@ -181,6 +181,10 @@ Toolbar.prototype = {
         this._setActiveToolBox(null);
     },
 
+    loadState : function(state) {
+        // do nothing by default
+    },
+
     slideIn : function(onComplete) {
         if (this._visible) {
             return;



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