[gnome-maps] sidebar: Hide load more results row when no more available



commit ddb5517bf5df7ed5b01672efd90991c6f25d865a
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Mar 22 22:05:12 2017 +0100

    sidebar: Hide load more results row when no more available
    
    When no later or earlier transit itineraries where found, hide the
    row to load more results.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780374

 src/sidebar.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/sidebar.js b/src/sidebar.js
index 273b1ef..736ea68 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -233,6 +233,13 @@ const Sidebar = new Lang.Class({
              * and so on */
         }).bind(this));
 
+        transitPlan.connect('no-more-results', (function() {
+            // remove the "load more" row, keep the empty row since it gives the separator
+            let numRows = this._transitOverviewListBox.get_children().length;
+            let loadMoreRow = this._transitOverviewListBox.get_row_at_index(numRows - 2);
+            this._transitOverviewListBox.remove(loadMoreRow);
+        }).bind(this));
+
         this._query.connect('notify', (function() {
             if (this._query.isValid()) {
                 this._instructionStack.visible_child = this._instructionSpinner;


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