From 38ddffd5562ab5da4d120e305b1bc898f8a6faf6 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 12 Feb 2009 03:15:39 -0800 Subject: [PATCH] Fixed bugs related to the display and hiding of previous note revisions: Incorrect widths and no (invisible) note grabber. --- NEWS | 1 + static/js/Editor.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index b99511c..3dbe485 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ not position the text cursor there. * Fixed a bug in which clicking on an unfocused note didn't position the text cursor in the correct location. + * Fixed bugs related to the display and hiding of previous note revisions. 1.6.3: February 11, 2009 * Introduced cache-busting code to make pages update more reliably after a diff --git a/static/js/Editor.js b/static/js/Editor.js index 4608119..ab2764f 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -148,11 +148,12 @@ Editor.prototype.create_div = function ( position_after ) { Editor.prototype.create_note_controls = function () { var iframe_id = "note_" + this.id; - if ( this.read_write ) { - this.grabber = createDOM( "td", { "id": "note_grabber_" + this.id, "class": "note_grabber" }, "....." ); - if ( !this.read_write || this.own_notes_only ) - addElementClass( this.grabber, "invisible" ); + this.grabber = createDOM( "td", { "id": "note_grabber_" + this.id, "class": "note_grabber" }, "....." ); + if ( !this.read_write || this.own_notes_only ) + addElementClass( this.grabber, "invisible" ); + + if ( this.read_write ) { this.delete_button = createDOM( "input", { "type": "button", "class": "note_button", @@ -1318,7 +1319,8 @@ Editor.prototype.blur = function () { this.scrape_title(); removeElementClass( this.iframe || this.div, "focused_note_frame" ); - removeElementClass( this.grabber, "note_grabber_focused" ); + if ( this.grabber ) + removeElementClass( this.grabber, "note_grabber_focused" ); } Editor.prototype.release_iframe = function () { @@ -1335,10 +1337,10 @@ Editor.prototype.release_iframe = function () { this.document = null; var static_contents = getFirstElementByTagAndClassName( "span", "static_note_contents", this.div ); - static_contents.innerHTML = contents; + if ( static_contents ) + static_contents.innerHTML = contents; - if ( this.div ) - removeElementClass( this.div, "invisible" ); + removeElementClass( this.div, "invisible" ); addElementClass( this.iframe, "invisible" ); setElementDimensions( this.iframe, { "h": 0 } ); this.iframe = null;