[gnome-documents] epubview: Update the visibility of the controls when the page changes



commit bec1ce21bc8031ee125bd70c08e320dd6c2d46c2
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jun 1 14:58:45 2017 +0200

    epubview: Update the visibility of the controls when the page changes
    
    Currently, the previous and next keys are not disabled at the limits
    of the document. That's why we need to re-evaluate their visibility
    whenever the page changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782685

 src/epubview.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/epubview.js b/src/epubview.js
index 7f146dc..52baba3 100644
--- a/src/epubview.js
+++ b/src/epubview.js
@@ -214,7 +214,10 @@ const EPUBViewNavControls = new Lang.Class({
 
         if (this._epubdoc != null) {
             this._level.set_range(1.0, this.preview.numPages);
-            this._epubdoc.connect('notify::page', Lang.bind(this, this._updatePage));
+            this._epubdoc.connect('notify::page', Lang.bind(this, function() {
+                this._updatePage();
+                this._updateVisibility();
+            }));
             this._updatePage();
         }
     },


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