witten
/
luminotes
Archived
1
0
Fork 0

Fixed bug in Safari/Chrome in which hiding an empty note caused it to get saved and end up in the "recent updates".

This commit is contained in:
Dan Helfman 2008-10-06 15:48:32 -07:00
parent 0d371cc490
commit 5944d1f20d
1 changed files with 5 additions and 5 deletions

View File

@ -521,17 +521,17 @@ Editor.prototype.blurred = function () {
this.scrape_title();
}
Editor.title_placeholder_char = "\u200b";
Editor.title_placeholder_pattern = /\u200b/g;
Editor.title_placeholder_html = "​​";
Editor.prototype.empty = function () {
if ( !this.document || !this.document.body )
return true; // consider it empty as of now
return ( scrapeText( this.document.body ).length == 0 );
return ( scrapeText( this.document.body ).replace( Editor.title_placeholder_pattern, "" ).length == 0 );
}
Editor.title_placeholder_char = "\u200b";
Editor.title_placeholder_pattern = /\u200b/g;
Editor.title_placeholder_html = "​​";
Editor.prototype.insert_link = function ( url ) {
// get the current selection, which is the link title
if ( this.iframe.contentWindow && this.iframe.contentWindow.getSelection ) { // browsers such as Firefox