1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-11 17:25:46 +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

@@ -2,6 +2,8 @@ Continuous donations:
* Daniel Bainton (web hosting)
2009:
* Norio Sugimoto
* Catatonic Recording
* Wataru Inoue (first one donating via addons.mozilla.org)
* Krishnakumar Subramanian
* Natan Zohar

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();
}
}
});
};

View File

@@ -19,7 +19,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.0</em:minVersion>
<em:maxVersion>3.6a1pre</em:maxVersion>
<em:maxVersion>3.6a2pre</em:maxVersion>
</Description>
</em:targetApplication>
</Description>