Merge pull request #3539 from tgxworld/fix_incorrect_check_for_highlighted_test

FIX: Incorrect check when no text is selected.
This commit is contained in:
Régis Hanol 2015-06-10 11:29:16 +02:00
commit a078eb1eed

View File

@ -27,7 +27,7 @@ export default DiscourseController.extend({
const selection = window.getSelection(); const selection = window.getSelection();
// no selections // no selections
if (selection.rangeCount === 0) return; if (selection.isCollapsed) return;
// retrieve the selected range // retrieve the selected range
const range = selection.getRangeAt(0), const range = selection.getRangeAt(0),