[gnome-documents] embed: Ensure that the old toolbar is destroyed when changing modes



commit 53fe30610e13b29adf23f38420638cee81bf38f3
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jan 2 13:05:16 2014 +0100

    embed: Ensure that the old toolbar is destroyed when changing modes
    
    Fallout from 65e878570d44638812d346a5db0cf3bfd7589e7d
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721194

 src/embed.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index f46276e..d591d36 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -425,6 +425,8 @@ const Embed = new Lang.Class({
             this._preview.setModel(null);
         if (this._edit)
             this._edit.setUri(null);
+        if (this._toolbar)
+            this._toolbar.widget.destroy();
 
         // pack the toolbar
         this._toolbar = new MainToolbar.OverviewToolbar(this._stackOverlay);
@@ -438,6 +440,8 @@ const Embed = new Lang.Class({
     _prepareForPreview: function() {
         if (this._edit)
             this._edit.setUri(null);
+        if (this._toolbar)
+            this._toolbar.widget.destroy();
 
         // pack the toolbar
         this._toolbar = new Preview.PreviewToolbar(this._preview);
@@ -448,6 +452,8 @@ const Embed = new Lang.Class({
     _prepareForEdit: function() {
         if (this._preview)
             this._preview.setModel(null);
+        if (this._toolbar)
+            this._toolbar.widget.destroy();
 
         // pack the toolbar
         this._toolbar = new Edit.EditToolbar(this._preview);


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