[gnome-documents/wip/cosimoc/view-rework: 5/20] embed: refactor clearing edit URI
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/cosimoc/view-rework: 5/20] embed: refactor clearing edit URI
- Date: Mon, 8 Aug 2016 15:06:54 +0000 (UTC)
commit 7eaa99883df708705180f9a2d11e7f8832f92b82
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Jul 31 21:24:44 2016 -0700
embed: refactor clearing edit URI
src/embed.js | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index 9a34a92..e8c072d 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -377,11 +377,13 @@ const Embed = new Lang.Class({
}));
},
- _clearPreview: function() {
+ _clearViewState: function() {
if (this._preview) {
this._preview.destroy();
this._preview = null;
}
+ if (this._edit)
+ this._edit.setUri(null);
this._window.insert_action_group('view', null);
},
@@ -408,9 +410,7 @@ const Embed = new Lang.Class({
break;
}
- this._clearPreview();
- if (this._edit)
- this._edit.setUri(null);
+ this._clearViewState();
if (createToolbar) {
if (this._toolbar)
@@ -426,9 +426,7 @@ const Embed = new Lang.Class({
},
_prepareForPreview: function(constructor) {
- this._clearPreview();
- if (this._edit)
- this._edit.setUri(null);
+ this._clearViewState();
if (this._toolbar)
this._toolbar.destroy();
@@ -444,7 +442,7 @@ const Embed = new Lang.Class({
},
_prepareForEdit: function() {
- this._clearPreview();
+ this._clearViewState();
if (this._toolbar)
this._toolbar.destroy();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]