From c40a180a5da0b2c97b64f2356d388e7bdd15ea76 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 7 Jan 2009 17:14:22 -0800 Subject: [PATCH] Now properly resizing a note if you cut/paste text in it with the mouse. Only works in FF3. --- static/js/Editor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/js/Editor.js b/static/js/Editor.js index f33e575..d951e9d 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -272,6 +272,7 @@ Editor.prototype.init_iframe = function () { selection.selectAllChildren( last_node ); selection.collapseToEnd(); } else if ( this.document.selection ) { // browsers such as IE + // TODO: finish this for IE var range = this.document.selection.createRange(); } } @@ -295,6 +296,8 @@ Editor.prototype.finish_init = function () { connect( this.document, "onclick", 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.contentWindow, "onpaste", function ( event ) { setTimeout( function () { self.resize() }, 50 ); } ); + connect( this.iframe.contentWindow, "oncut", function ( event ) { setTimeout( function () { self.resize() }, 50 ); } ); // handle each form submit event by forwarding it on as a custom event function connect_form( form ) {