Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed make xhr loading in ie11 #5307

Merged
merged 1 commit into from
Oct 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
20 changes: 1 addition & 19 deletions src/util/dom_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() { }

/**
Expand All @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/util/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down