From 56b25bd1ffc017b8794781895128a23b854e072f Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 12 Feb 2009 13:19:29 -0800 Subject: [PATCH] Re-added editor_focused( null ) in hide_editor() and delete_editor(), but now passing in a flag that prevents save_editor() from being double called. --- NEWS | 5 ++++- static/js/Wiki.js | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 874c8bb..38ed2d2 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ 1.6.5: February 12, 2009 - * + * Fixed a bug in which hiding a focused note could cause the subsequent note + to display incorrectly Internet Explorer. + * Re-fixed a bug in which hiding a focused note could (temporarily) leave an + empty gap at the bottom of the page. 1.6.4: February 12, 2009 * Now ignoring certain unneeded HTML tags that end up in your notes when you diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 0bd2f39..8f5074e 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -1016,9 +1016,11 @@ Wiki.prototype.update_link_with_suggestion = function ( editor, link, note ) { this.display_link_pulldown( editor, link ); } -Wiki.prototype.editor_focused = function ( editor, synchronous, remove_empty ) { +Wiki.prototype.editor_focused = function ( editor, synchronous, remove_empty, save_blurred ) { if ( remove_empty == undefined ) remove_empty = true; + if ( save_blurred == undefined ) + save_blurred = true; if ( this.focused_editor && this.focused_editor != editor ) { this.focused_editor.blur(); @@ -1034,7 +1036,7 @@ Wiki.prototype.editor_focused = function ( editor, synchronous, remove_empty ) { this.focused_editor.shutdown(); this.decrement_total_notes_count(); this.display_empty_message(); - } else { + } else if ( save_blurred ) { // when switching editors, save the one being left this.save_editor( null, null, null, synchronous ); } @@ -1528,6 +1530,9 @@ Wiki.prototype.hide_editor = function ( event, editor ) { this.clear_messages(); this.clear_pulldowns(); + if ( this.focused_editor ) + this.editor_focused( null, false, true, false ); + if ( !editor ) { editor = this.focused_editor; this.focused_editor = null; @@ -1564,6 +1569,9 @@ Wiki.prototype.delete_editor = function ( event, editor ) { this.clear_messages(); this.clear_pulldowns(); + if ( this.focused_editor ) + this.editor_focused( null, false, true, false ); + if ( !editor ) { editor = this.focused_editor; this.focused_editor = null;