From d555121a1cdace40454bc4917dcfa81d1ebdcca0 Mon Sep 17 00:00:00 2001 From: Markus Bordihn Date: Tue, 25 Aug 2015 15:39:09 +0200 Subject: [PATCH] Update utils.js There is no global "getSelection()" function, see: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection --- core/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/utils.js b/core/utils.js index 149b365c6..4f1bdfb63 100644 --- a/core/utils.js +++ b/core/utils.js @@ -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(); }