From 19a24d9d78990cc943972468bde39b344a111e4d Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 7 Jan 2009 12:57:51 -0800 Subject: [PATCH] Fixed Editor.dirty() and Editor.mark_clean() to deal with divs in addition to iframes. --- static/js/Editor.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/static/js/Editor.js b/static/js/Editor.js index 7e487e2..ac53b72 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -976,20 +976,17 @@ function normalize_html( html ) { } Editor.prototype.dirty = function () { - if ( !this.iframe || !this.document ) - return false; - var original_html = normalize_html( this.initial_text ) - var current_html = normalize_html( this.document.body.innerHTML ) + var current_html = normalize_html( this.contents() ); - if ( current_html == original_html ) + if ( current_html == "" || current_html == original_html ) return false; return true; } Editor.prototype.mark_clean = function () { - this.initial_text = this.document.body.innerHTML; + this.initial_text = this.contents(); } Editor.prototype.mark_dirty = function () {