diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 7be28de..92e68d9 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -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 ) {