witten
/
luminotes
Archived
1
0
Fork 0

When search text field is blurred, redisplay "search" in it.

This commit is contained in:
Dan Helfman 2008-04-04 06:28:26 +00:00
parent d232826d0b
commit a072cbc5ae
1 changed files with 8 additions and 0 deletions

View File

@ -63,6 +63,7 @@ function Wiki( invoker ) {
connect( this.invoker, "message", this, "display_message" );
connect( "search_form", "onsubmit", this, "search" );
connect( "search_text", "onfocus", this, "search_focused" );
connect( "search_text", "onblur", this, "search_blurred" );
connect( "html", "onclick", this, "background_clicked" );
connect( "html", "onkeydown", this, "key_pressed" );
connect( window, "onresize", this, "resize_editors" );
@ -1321,6 +1322,13 @@ Wiki.prototype.search_focused = function ( event ) {
search_text.value = '';
}
Wiki.prototype.search_blurred = function ( event ) {
var search_text = getElement( "search_text" );
if ( search_text.value == '' )
search_text.value = 'search';
}
Wiki.prototype.display_search_results = function ( result ) {
// if there are no search results, indicate that and bail
if ( !result || result.notes.length == 0 ) {