From 9fa3cf2001ea11718c8085f0c4fa3b671d30a2cd Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 21 Jan 2009 13:43:45 -0800 Subject: [PATCH] Resizing new iframe on load. --- static/js/Editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/Editor.js b/static/js/Editor.js index f6b3f9a..cc5021f 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -229,7 +229,6 @@ Editor.prototype.claim_iframe = function ( position_after, click_position ) { var range = this.add_selection_bookmark(); this.set_iframe_contents( this.contents() ); this.remove_selection_bookmark( range ); - this.resize( frame_height ); // make the completed iframe visible and hide the static div addElementClass( this.iframe, "focused_note_frame" ); @@ -433,6 +432,7 @@ Editor.prototype.connect_handlers = function () { connect( this.document, "onmouseup", function ( event ) { self.mouse_clicked( event ); } ); connect( this.document, "onmouseover", function ( event ) { self.mouse_hovered( event ); } ); connect( this.document, "ondragover", function ( event ) { self.mouse_dragged( event ); } ); + connect( this.iframe, "onload", function () { self.resize(); } ); connect( this.iframe, "onresize", function () { setTimeout( function () { self.resize() }, 50 ); } ); connect( this.iframe.contentWindow, "onpaste", function ( event ) { setTimeout( function () { self.resize() }, 50 ); } ); connect( this.iframe.contentWindow, "oncut", function ( event ) { setTimeout( function () { self.resize() }, 50 ); } );