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:
parent
5afee52199
commit
25db885cb8
|
@ -1032,7 +1032,6 @@ Wiki.prototype.editor_focused = function ( editor, synchronous ) {
|
||||||
|
|
||||||
this.focused_editor = editor;
|
this.focused_editor = editor;
|
||||||
this.update_toolbar();
|
this.update_toolbar();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Wiki.prototype.make_byline = function ( username, creation, note_id ) {
|
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 () {
|
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" );
|
var div = getFirstElementByTagAndClassName( "div", "static_note_div" );
|
||||||
if ( !div || !div.editor ) return;
|
if ( !div || !div.editor ) return;
|
||||||
div.editor.highlight();
|
div.editor.highlight();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var previous_holder = this.focused_editor.holder.previousSibling;
|
var previous_holder = editor.holder.previousSibling;
|
||||||
if ( !previous_holder ) return;
|
if ( !previous_holder ) return;
|
||||||
if ( !hasElementClass( previous_holder, "note_holder" ) )
|
if ( !hasElementClass( previous_holder, "note_holder" ) )
|
||||||
previous_holder = previous_holder.previousSibling;
|
previous_holder = previous_holder.previousSibling;
|
||||||
|
@ -1213,14 +1215,17 @@ Wiki.prototype.focus_next_editor = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
Wiki.prototype.focus_previous_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" );
|
var div = getFirstElementByTagAndClassName( "div", "static_note_div" );
|
||||||
if ( !div || !div.editor ) return;
|
if ( !div || !div.editor ) return;
|
||||||
div.editor.highlight();
|
div.editor.highlight();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var next_holder = this.focused_editor.holder.nextSibling;
|
var next_holder = editor.holder.nextSibling;
|
||||||
if ( !next_holder ) return;
|
if ( !next_holder ) return;
|
||||||
if ( !hasElementClass( next_holder, "note_holder" ) )
|
if ( !hasElementClass( next_holder, "note_holder" ) )
|
||||||
next_holder = next_holder.nextSibling;
|
next_holder = next_holder.nextSibling;
|
||||||
|
|
Reference in New Issue