Fix up triggering search in the overlay.

Make sure to set this._searchQueued to true, so that we don't queue the search twice.

Remove an unused variable.
This commit is contained in:
Marina Zhurakhinskaya 2009-02-13 15:31:10 -05:00
parent 0eb4873ba0
commit 87f50c3f42

View File

@ -113,15 +113,14 @@ Sideshow.prototype = {
text: ""}); text: ""});
this.actor.add_actor(this._searchEntry); this.actor.add_actor(this._searchEntry);
this._searchQueued = false; this._searchQueued = false;
this._searchActive = false;
this._searchEntry.connect('notify::text', function (se, prop) { this._searchEntry.connect('notify::text', function (se, prop) {
if (me._searchQueued) if (me._searchQueued)
return; return;
me._searchQueued = true;
Mainloop.timeout_add(250, function() { Mainloop.timeout_add(250, function() {
// Strip leading and trailing whitespace // Strip leading and trailing whitespace
let text = me._searchEntry.text.replace(/^\s+/g, "").replace(/\s+$/g, ""); let text = me._searchEntry.text.replace(/^\s+/g, "").replace(/\s+$/g, "");
me._searchQueued = false; me._searchQueued = false;
me._searchActive = text != '';
me._appDisplay.setSearch(text); me._appDisplay.setSearch(text);
me._docDisplay.setSearch(text); me._docDisplay.setSearch(text);
return false; return false;