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:
parent
84f6da7c27
commit
ada0ce8319
4
NEWS
4
NEWS
|
@ -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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Reference in New Issue
Block a user