From caaff7af5943411fa073aa23e3caa27bb859ea65 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 29 Jan 2009 15:52:11 -0800 Subject: [PATCH] Fixed a bug in which performing a search when search results were already open would just hide the initial search results without showing the new ones. --- NEWS | 3 +++ static/js/Wiki.js | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index a54b75d..87a105b 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ 1.6.1: * Fixed a bug in which hiding a focused note could (temporarily) leave an empty gap at the bottom of the page. + * Fixed a bug in which performing a search when search results were already + open would just hide the initial search results without showing the new + ones. 1.6.0: January 27, 2009 * Switching between notebooks and loading notebooks is now much faster. diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 59f2f63..598d838 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -1971,14 +1971,13 @@ Wiki.prototype.notebook_has_tag = function ( notebook, tag_name, tag_value ) { Wiki.prototype.display_search_results = function ( result ) { // if there are no search results, indicate that and bail if ( !result || result.notes.length == 0 ) { + if ( this.search_results_editor ) + this.search_results_editor.shutdown(); this.display_message( "No matching notes.", undefined, getElement( "notes_top" ) ); return; } - // create a "magic" search results note. but first close any open search results notes - if ( this.search_results_editor ) - this.search_results_editor.shutdown(); - + // create a "magic" search results note if ( this.notebook_has_tag( this.notebook, "forum" ) ) var notebook_word = "discussion"; else