Simplified cleanup_range() function.
This commit is contained in:
parent
73ba66ea72
commit
81e3ca7ab2
|
@ -1031,17 +1031,10 @@ Editor.prototype.cleanup_html = function ( key_code ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Editor.prototype.cleanup_range = function () {
|
Editor.prototype.cleanup_range = function () {
|
||||||
if ( !this.iframe.contentWindow.getSelection )
|
if ( this.iframe.contentWindow.getSelection )
|
||||||
return;
|
var selection = this.iframe.contentWindow.getSelection();
|
||||||
|
if ( selection.isCollapsed )
|
||||||
var selection = this.iframe.contentWindow.getSelection();
|
this.exec_command( "removeformat" );
|
||||||
if ( selection.rangeCount > 0 )
|
|
||||||
var range = selection.getRangeAt( 0 );
|
|
||||||
else
|
|
||||||
var range = this.document.createRange();
|
|
||||||
|
|
||||||
if ( range.collapsed )
|
|
||||||
this.exec_command( "removeformat" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Editor.prototype.unformat_selection = function () {
|
Editor.prototype.unformat_selection = function () {
|
||||||
|
|
Reference in New Issue