Commit d555121a authored by Markus Bordihn's avatar Markus Bordihn

Update utils.js

There is no global "getSelection()" function, see:
https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection
parent 218fdc66
......@@ -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