[gnome-documents] searchbar: only block changes on hide while in preview



commit 9f9f792ff8258a4832f7afbac297b989f6ad45c6
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Feb 19 18:56:28 2013 -0500

    searchbar: only block changes on hide while in preview
    
    We actually want to cancel the current search if we close the entry in
    the overview.

 src/preview.js   |    2 ++
 src/searchbar.js |    5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/preview.js b/src/preview.js
index 0c1c8c8..61a0aa0 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -939,7 +939,9 @@ const PreviewSearchbar = new Lang.Class({
     hide: function() {
         this._previewView.view.find_set_highlight_search(false);
 
+        this.searchChangeBlocked = true;
         this.parent();
+        this.searchChangeBlocked = false;
     }
 });
 
diff --git a/src/searchbar.js b/src/searchbar.js
index 3feafb9..6d8fc21 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -44,6 +44,7 @@ const Searchbar = new Lang.Class({
         this._searchEntryTimeout = 0;
         this._searchTypeId = 0;
         this._searchMatchId = 0;
+        this.searchChangeBlocked = false;
 
         this._in = false;
 
@@ -81,7 +82,7 @@ const Searchbar = new Lang.Class({
                     this._searchEntryTimeout = 0;
                 }
 
-                if (this._searchChangeBlocked)
+                if (this.searchChangeBlocked)
                     return;
 
                 this._searchEntryTimeout = Mainloop.timeout_add(_SEARCH_ENTRY_TIMEOUT, Lang.bind(this,
@@ -209,9 +210,7 @@ const Searchbar = new Lang.Class({
         this._in = false;
         this.widget.set_reveal_child(false);
         // clear all the search properties when hiding the entry
-        this._searchChangeBlocked = true;
         this._searchEntry.set_text('');
-        this._searchChangeBlocked = false;
     }
 });
 


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