0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Ensure removeAllFormatting always returns self.

This commit is contained in:
Neil Jenkins 2015-06-17 14:23:52 +07:00
parent 36432d45bd
commit 8b112b7615

View file

@ -2188,15 +2188,15 @@ var stylingNodeNames = /(^|>)(?:B|I|S|SUB|SUP|U|BLOCKQUOTE|OL|UL|LI|T(?:ABLE|BOD
proto.removeAllFormatting = function ( range ) {
if ( !range && !( range = this.getSelection() ) || range.collapsed ) {
return false;
return this;
}
var stopNode = range.commonAncestorContainer;
while ( stylingNodeNames.test( getPath( stopNode ) ) ) {
stopNode = stopNode.parentNode;
}
return false;
if ( stopNode.nodeType === TEXT_NODE ) {
return this;
}
moveRangeBoundariesUpTree( range, stopNode );