From b2eaa5a1682b97a97437e9d608364bc00c8fa243 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 6 Jan 2009 16:28:01 -0800 Subject: [PATCH] Don't blur an iframe as soon as the focus leaves, but rather when another editor is focused. This makes the toolbar work again. --- static/js/Editor.js | 4 ---- static/js/Wiki.js | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/static/js/Editor.js b/static/js/Editor.js index 6bc44bc..704e025 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -275,12 +275,8 @@ Editor.prototype.finish_init = function () { connect( this.document, "onkeydown", function ( event ) { self.key_pressed( event ); } ); connect( this.document, "onkeyup", function ( event ) { self.key_released( event ); } ); } - connect( this.iframe, "onblur", function ( event ) { self.blurred( event ); } ); - connect( this.document, "onblur", function ( event ) { self.blurred( event ); } ); connect( this.document, "onfocus", function ( event ) { self.focused( event ); } ); - connect( this.document.body, "onblur", function ( event ) { self.blurred( event ); } ); connect( this.document.body, "onfocus", function ( event ) { self.focused( event ); } ); - connect( this.iframe.contentWindow, "onblur", function ( event ) { self.blurred( event ); } ); connect( this.iframe.contentWindow, "onfocus", function ( event ) { self.focused( event ); } ); connect( this.document, "onclick", function ( event ) { self.mouse_clicked( event ); } ); connect( this.document, "onmouseover", function ( event ) { self.mouse_hovered( event ); } ); diff --git a/static/js/Wiki.js b/static/js/Wiki.js index b6bf466..37df3d0 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -1017,6 +1017,7 @@ Wiki.prototype.editor_focused = function ( editor, synchronous ) { if ( this.focused_editor && this.focused_editor != editor && this.focused_editor.iframe ) { this.clear_pulldowns(); removeElementClass( this.focused_editor.iframe, "focused_note_frame" ); + this.focused_editor.blurred(); // if the formerly focused editor is completely empty, then remove it as the user leaves it and switches to this editor if ( this.focused_editor.id == this.blank_editor_id && this.focused_editor.empty() ) {