[gnome-documents] Don't stomp on the search criteria when going back from a collection



commit 9f62a7c9b1b6a10637533daa762130f35efc21fc
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Mar 17 20:36:41 2015 +0100

    Don't stomp on the search criteria when going back from a collection
    
    There are two things going on here:
      - We want to restore the search criteria when going back to the
        search results from a collection
      - We want to relax the search criteria when viewing a collection
        from the search results
    
    There is no need to do the later when there is no active collection.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746367

 src/searchbar.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/searchbar.js b/src/searchbar.js
index d331d7f..ebd61d6 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -239,7 +239,10 @@ const OverviewSearchbar = new Lang.Class({
         this._searchEntry.set_text(string);
     },
 
-    _onActiveCollectionChanged: function() {
+    _onActiveCollectionChanged: function(manager, collection) {
+        if (!collection)
+            return;
+
         let searchType = Application.searchTypeManager.getActiveItem();
 
         if (Application.searchController.getString() != '' ||


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