witten
/
luminotes
Archived
1
0
Fork 0

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.

This commit is contained in:
Dan Helfman 2009-02-12 13:19:29 -08:00
parent fdc755f11e
commit 56b25bd1ff
2 changed files with 14 additions and 3 deletions

5
NEWS
View File

@ -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

View File

@ -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;