Commit 88ac36db authored by Neil Fraser's avatar Neil Fraser

Merge pull request #168 from Kaworru/patch-1

Add window scope for getSelection.
parents 218fdc66 d555121a
......@@ -349,10 +349,10 @@ Blockly.createSvgElement = function(name, attrs, parent, opt_workspace) {
* Deselect this text, so that it doesn't mess up any subsequent drag.
*/
Blockly.removeAllRanges = function() {
if (getSelection()) {
if (window.getSelection) {
setTimeout(function() {
try {
var selection = getSelection();
var selection = window.getSelection();
if (!selection.isCollapsed) {
selection.removeAllRanges();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment