Skip to content

Instantly share code, notes, and snippets.

@brutuscat
Created May 14, 2013 14:24
Show Gist options
  • Save brutuscat/5576343 to your computer and use it in GitHub Desktop.
Save brutuscat/5576343 to your computer and use it in GitHub Desktop.
getCurrentRange = function () {
var sel = window.getSelection();
var active = document.activeElement;
if (editor[0] == active && sel.getRangeAt && sel.rangeCount) {
return sel.getRangeAt(0);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment