Archived
1
0

Fixed a Firefox bug in which removing some bold text and then typing new text would make the new text bold.

This commit is contained in:
Dan Helfman 2009-04-26 16:45:18 -07:00
parent 84f6da7c27
commit ada0ce8319
2 changed files with 15 additions and 0 deletions

4
NEWS
View File

@ -3,6 +3,10 @@
themes in a subsequent release.
* Changed some of the "+" buttons to be more descriptive: "+ notebook" and
"+ quick link".
* Fixed a Firefox bug in which removing some bold text and then typing new
text would make the new text bold. Now, if you completely remove some bold
text (rather than just a portion of it), any new text that you type will be
unformatted.
* Fixed a bug in which toolbar buttons didn't depress based on the current
location of the text cursor.

View File

@ -927,6 +927,17 @@ Editor.prototype.key_released = function ( event ) {
}
Editor.prototype.cleanup_html = function ( key_code ) {
if ( this.iframe.contentWindow.getSelection ) {
var selection = this.iframe.contentWindow.getSelection();
if ( selection.rangeCount > 0 )
var range = selection.getRangeAt( 0 );
else
var range = this.document.createRange();
var fragment = range.cloneContents();
if ( fragment.childNodes.length == 0 )
this.exec_command( "removeformat" );
}
if ( WEBKIT ) {
// if enter is pressed while in a title, end title mode, since WebKit doesn't do that for us
var ENTER = 13; BACKSPACE = 8;