From 55ebeffe9658ab11863841519e20bf3dc680a9a8 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sun, 14 Oct 2018 11:20:02 +0200 Subject: [PATCH] fixed loading in ie11 --- src/parser.js | 1 - src/util/dom_request.js | 20 +------------------- src/util/misc.js | 2 +- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/parser.js b/src/parser.js index 44426c75a69..774218bb747 100644 --- a/src/parser.js +++ b/src/parser.js @@ -464,7 +464,6 @@ */ function parseUseDirectives(doc) { var nodelist = _getMultipleNodes(doc, ['use', 'svg:use']), i = 0; - while (nodelist.length && i < nodelist.length) { var el = nodelist[i], xlink = (el.getAttribute('xlink:href') || el.getAttribute('href')).substr(1), diff --git a/src/util/dom_request.js b/src/util/dom_request.js index 9a1d499b8c1..13026af6ea7 100644 --- a/src/util/dom_request.js +++ b/src/util/dom_request.js @@ -4,24 +4,6 @@ return url + (/\?/.test(url) ? '&' : '?') + param; } - var makeXHR = (function() { - var factories = [ - function() { return new fabric.window.XMLHttpRequest(); }, - function() { return new ActiveXObject('Microsoft.XMLHTTP'); }, - function() { return new ActiveXObject('Msxml2.XMLHTTP'); }, - function() { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } - ]; - for (var i = factories.length; i--; ) { - try { - var req = factories[i](); - if (req) { - return factories[i]; - } - } - catch (err) { } - } - })(); - function emptyFn() { } /** @@ -40,7 +22,7 @@ var method = options.method ? options.method.toUpperCase() : 'GET', onComplete = options.onComplete || function() { }, - xhr = makeXHR(), + xhr = new fabric.window.XMLHttpRequest(), body = options.body || options.parameters; /** @ignore */ diff --git a/src/util/misc.js b/src/util/misc.js index 9d3ef3b9ce8..2f830e876a7 100644 --- a/src/util/misc.js +++ b/src/util/misc.js @@ -491,7 +491,7 @@ */ groupSVGElements: function(elements, options, path) { var object; - if (elements.length === 1) { + if (elements && elements.length === 1) { return elements[0]; } if (options) {