Skip to content

Commit

Permalink
Removed 'selection.getSelectedHtml()'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun authored and Reinmar committed Feb 24, 2015
1 parent 313ae98 commit 88d9937
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions core/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1597,37 +1597,6 @@
return ( cache.selectedText = text );
},

/**
* Retrieves the HTML contained within the range. If selection
* contains multiple ranges method will return concatenation of HTMLs from ranges.
*
* var text = editor.getSelection().getSelectedText();
* alert( text );
*
* @since 4.4
* @returns {String} A string of HTML within the current selection.
*/
getSelectedHtml: function() {
var nativeSel = this.getNative();

if ( this.isFake ) {
return this.getSelectedElement().getHtml();
}

if ( nativeSel && nativeSel.createRange )
return nativeSel.createRange().htmlText;

if ( nativeSel.rangeCount > 0 ) {
var div = document.createElement( 'div' );

for ( var i = 0; i < nativeSel.rangeCount; i++ ) {
div.appendChild( nativeSel.getRangeAt( i ).cloneContents() );
}
return div.innerHTML;
}
return '';
},

/**
* Locks the selection made in the editor in order to make it possible to
* manipulate it without browser interference. A locked selection is
Expand Down

0 comments on commit 88d9937

Please sign in to comment.