witten
/
luminotes
Archived
1
0
Fork 0

Possibly fixed a bug in which the displayed suggestions sometimes did not

reflect the most recent characters typed.
This commit is contained in:
Dan Helfman 2008-07-07 15:49:01 -07:00
parent 6ac620beb0
commit 7f1a644a61
2 changed files with 14 additions and 2 deletions

4
NEWS
View File

@ -1,4 +1,4 @@
1.4.12: July ??, 2008:
1.4.12: July 7, 2008:
* Fixed a bug in which tab/shift-tab for indending/outdenting nested lists
no longer worked. Also made it work in IE as well (which it never has).
* controller.Root.guide() now accepts an optional note_id parameter.
@ -7,6 +7,8 @@
to a race condition between the link info pulldown's onblur/onchange
handler and the suggestion onclick handler, both of which tried to update
the link, title, and summary at about the same time.
* Possibly fixed a bug in which the displayed suggestions sometimes did not
reflect the most recent characters typed.
1.4.11: June 29, 2008:
* Fixed bug in which bolding of suggest-as-you-type search text was case

View File

@ -3450,6 +3450,7 @@ function Suggest_pulldown( wiki, notebook_id, invoker, anchor, relative_to, sear
anchor.pulldown = this;
this.anchor = anchor;
this.previous_search_text = "";
this.sequence_number = 0;
Pulldown.call( this, wiki, notebook_id, "suggest_pulldown", anchor, relative_to );
@ -3479,12 +3480,21 @@ Suggest_pulldown.prototype.update_suggestions = function ( search_text ) {
var self = this;
this.previous_search_text = search_text;
this.sequence_number += 1;
var sequence_number = this.sequence_number;
this.invoker.invoke( "/notebooks/search_titles", "GET", {
"notebook_id": this.notebook_id,
"search_text": search_text
},
function( result ) { self.display_suggestions( result, search_text ); }
function( result ) {
// if the sequence number is not what we expect, then this must not be most recent suggests
// update, so bail without displaying the result
if ( self.sequence_number != sequence_number )
return;
self.display_suggestions( result, search_text );
}
);
}