1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 15:24:11 +01:00

Fix completions for FF3.6

Also see: https://bugzilla.mozilla.org/show_bug.cgi?id=510589
This commit is contained in:
Martin Stubenschrott
2009-08-14 23:45:42 +02:00
parent e842bf8cc9
commit fb44ca22dc
5 changed files with 19 additions and 25 deletions

View File

@@ -324,6 +324,7 @@ const config = { //{{{
////////////////////// COMPLETIONS /////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589
completion.location = function location(context) {
if (!services.get("autoCompleteSearch"))
return;
@@ -334,7 +335,7 @@ const config = { //{{{
context.incomplete = true;
context.hasItems = context.completions.length > 0; // XXX
context.filterFunc = null;
context.cancel = function () services.get("autoCompleteSearch").stopSearch();
context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } };
context.compare = CompletionContext.Sort.unsorted;
let timer = new Timer(50, 100, function (result) {
context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING;
@@ -343,13 +344,17 @@ const config = { //{{{
for (i in util.range(0, result.matchCount))
];
});
services.get("autoCompleteSearch").stopSearch();
if (searchRunning)
services.get("autoCompleteSearch").stopSearch();
searchRunning = true;
services.get("autoCompleteSearch").startSearch(context.filter, "", context.result, {
onSearchResult: function onSearchResult(search, result) {
context.result = result;
timer.tell(result);
if (result.searchResult <= result.RESULT_SUCCESS)
{
searchRunning = false;
timer.flush();
}
}
});
};