- bug: if you save a note that fails to be saved, e.g. due to being longer than 25k characters in size, then the note still shows up in
recent updates. fixed by making it so that when an error is received by invoker, the error message is displayed but the callback is not invoked - bug: if you get an error when saving a note, the note should not disappear. it should still be present so you can try to save it again - make invoker not call a callback if there's an error - in Wiki.hide_editor(), only close an editor after save_editor() has invoked a provided callback function - make sure this doesn't break the note conflict notification error (saved editor should still shutdown) - test this in IE
This commit is contained in:
parent
8bed4a7f4d
commit
9e0177f90c
|
@ -70,18 +70,18 @@ Invoker.prototype.handle_response = function ( request, callback ) {
|
|||
|
||||
var result = evalJSONRequest( request );
|
||||
|
||||
if ( result.error )
|
||||
if ( result.error ) {
|
||||
signal( this, "error_message", result.error );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( result.message )
|
||||
signal( this, "message", result.message );
|
||||
|
||||
if ( callback )
|
||||
callback( result );
|
||||
|
||||
if ( result.redirect )
|
||||
else if ( result.redirect )
|
||||
window.location = result.redirect;
|
||||
|
||||
if ( result.reload )
|
||||
else if ( result.reload )
|
||||
window.location.reload();
|
||||
}
|
||||
|
|
|
@ -1084,15 +1084,17 @@ Wiki.prototype.hide_editor = function ( event, editor ) {
|
|||
signal( this, "note_removed", editor.id );
|
||||
editor.shutdown();
|
||||
this.decrement_total_notes_count();
|
||||
this.display_empty_message();
|
||||
} else {
|
||||
// before hiding an editor, save it
|
||||
if ( this.notebook.read_write && editor.read_write )
|
||||
this.save_editor( editor );
|
||||
|
||||
if ( this.notebook.read_write && editor.read_write ) {
|
||||
var self = this;
|
||||
this.save_editor( editor, false, function () {
|
||||
editor.shutdown();
|
||||
self.display_empty_message();
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
this.display_empty_message();
|
||||
}
|
||||
|
||||
event.stop();
|
||||
|
@ -3090,6 +3092,6 @@ Recent_notes.prototype.update_link = function ( editor ) {
|
|||
|
||||
// the link is already in the recent notes list, so just move it to the top of the list
|
||||
removeElement( item );
|
||||
replaceChildNodes( link, editor.title );
|
||||
replaceChildNodes( link, editor.title || "untitled note" );
|
||||
insertSiblingNodesAfter( "recent_notes_top", item );
|
||||
}
|
||||
|
|
Reference in New Issue