[gnome-documents] preview: Simplify the PreviewNavButtons show/hide code
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] preview: Simplify the PreviewNavButtons show/hide code
- Date: Tue, 24 Dec 2013 11:56:22 +0000 (UTC)
commit 894d8e7d379f4ccfa7402562742cba2944fce331
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Dec 23 17:46:36 2013 +0100
preview: Simplify the PreviewNavButtons show/hide code
We could just call _updateVisibility instead of fading it in and out
ourself.
In fact, it would be more correct to do so because otherwise show will
always fade in both widgets -- which is wrong. The reason it works
correctly now is that show is called before setModel. So the call to
_fadeInButton from show aborts because this._model is null. This is
due to the particular order in which _onLoadFinished is called in
PreviewView and Embed.
https://bugzilla.gnome.org/show_bug.cgi?id=720985
src/preview.js | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/preview.js b/src/preview.js
index 2cc40e2..1436354 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -796,14 +796,12 @@ const PreviewNavButtons = new Lang.Class({
show: function() {
this._visible = true;
- this._fadeInButton(this.prev_widget);
- this._fadeInButton(this.next_widget);
+ this._updateVisibility();
},
hide: function() {
this._visible = false;
- this._fadeOutButton(this.prev_widget);
- this._fadeOutButton(this.next_widget);
+ this._updateVisibility();
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]