Adapt fallback for selection

Thanks @darthmaim for pointing this out
This commit is contained in:
Rupert Angermeier 2015-02-19 16:31:27 +01:00
parent 8290c4f726
commit 42cf8d3679

View File

@ -10,7 +10,7 @@ var h = require('../../lib/helper')
function bindSelectionHandler(element, i) { function bindSelectionHandler(element, i) {
function getRangeNode() { function getRangeNode() {
var selection = window.getSelection ? window.getSelection() : var selection = window.getSelection ? window.getSelection() :
document.getSelection ? document.getSelection() : {rangeCount: 0}; document.getSelection ? document.getSelection() : '';
if (selection.toString().length === 0) { if (selection.toString().length === 0) {
return null; return null;
} else { } else {