witten
/
luminotes
Archived
1
0
Fork 0

Fix to prevent iframe editor from remaining focused when switching to a different static div editor with page up / page down.

This commit is contained in:
Dan Helfman 2009-01-27 16:13:23 -08:00
parent 5afee52199
commit 25db885cb8
1 changed files with 10 additions and 5 deletions

View File

@ -1032,7 +1032,6 @@ Wiki.prototype.editor_focused = function ( editor, synchronous ) {
this.focused_editor = editor;
this.update_toolbar();
}
Wiki.prototype.make_byline = function ( username, creation, note_id ) {
@ -1195,14 +1194,17 @@ Wiki.prototype.editor_key_pressed = function ( editor, event ) {
}
Wiki.prototype.focus_next_editor = function () {
if ( !this.focused_editor ) {
if ( this.focused_editor ) {
var editor = this.focused_editor;
this.editor_focused( null );
} else {
var div = getFirstElementByTagAndClassName( "div", "static_note_div" );
if ( !div || !div.editor ) return;
div.editor.highlight();
return;
}
var previous_holder = this.focused_editor.holder.previousSibling;
var previous_holder = editor.holder.previousSibling;
if ( !previous_holder ) return;
if ( !hasElementClass( previous_holder, "note_holder" ) )
previous_holder = previous_holder.previousSibling;
@ -1213,14 +1215,17 @@ Wiki.prototype.focus_next_editor = function () {
}
Wiki.prototype.focus_previous_editor = function () {
if ( !this.focused_editor ) {
if ( this.focused_editor ) {
var editor = this.focused_editor;
this.editor_focused( null );
} else {
var div = getFirstElementByTagAndClassName( "div", "static_note_div" );
if ( !div || !div.editor ) return;
div.editor.highlight();
return;
}
var next_holder = this.focused_editor.holder.nextSibling;
var next_holder = editor.holder.nextSibling;
if ( !next_holder ) return;
if ( !hasElementClass( next_holder, "note_holder" ) )
next_holder = next_holder.nextSibling;