diff --git a/static/js/Editor.js b/static/js/Editor.js index 976d7d9..b328c04 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -51,6 +51,10 @@ function Shared_iframe() { document.close(); } +Shared_iframe.prototype.editor = function () { + return this.iframe.editor; +} + function Editor( id, notebook_id, note_text, deleted_from_id, revision, read_write, startup, highlight, focus, position_after, start_dirty, own_notes_only ) { this.id = id; diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 410bfa5..c69c220 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -489,8 +489,8 @@ Wiki.prototype.create_blank_editor = function ( event ) { } // if there is already a blank editor, then highlight it and bail - if ( Editor.shared_iframe && Editor.shared_iframe.editor && Editor.shared_iframe.editor.empty() ) { - Editor.shared_iframe.editor.highlight(); + if ( Editor.shared_iframe && Editor.shared_iframe.editor() && Editor.shared_iframe.editor().empty() ) { + Editor.shared_iframe.editor().highlight(); return; } @@ -854,8 +854,8 @@ Wiki.prototype.create_editor = function ( id, note_text, deleted_from_id, revisi } Wiki.prototype.resize_editor = function () { - if ( Editor.shared_frame && Editor.shared_iframe.editor ) - Editor.shared_iframe.editor.resize(); + if ( Editor.shared_iframe && Editor.shared_iframe.editor() ) + Editor.shared_iframe.editor().resize(); } Wiki.prototype.resize_toolbar = function () {