Commit 9ba32176 by kevalbhatt Committed by Sarath Subramanian

ATLAS-3473: UI : Delay in loading Lineage icon because of sync img call

parent e04acda4
...@@ -584,8 +584,7 @@ define(['require', ...@@ -584,8 +584,7 @@ define(['require',
var imagePath = options.imagePath, var imagePath = options.imagePath,
ajaxOptions = { ajaxOptions = {
"url": imagePath, "url": imagePath,
"method": "get", "method": "get"
"async": false,
} }
if (platform.name !== "IE") { if (platform.name !== "IE") {
...@@ -604,29 +603,17 @@ define(['require', ...@@ -604,29 +603,17 @@ define(['require',
} else { } else {
imageObject[imageIconPath] = imagePath; imageObject[imageIconPath] = imagePath;
} }
d3.select(that).attr("xlink:href", imageObject[imageIconPath]);
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
} }
}); });
} }
if (_.keys(imageObject).indexOf(imageIconPath) === -1) {
getImageData({ getImageData({
"imagePath": imageIconPath "imagePath": imageIconPath
}); });
} }
if (_.isUndefined(imageObject[imageIconPath])) {
// before img success
imageObject[imageIconPath] = [d3.select(that)];
} else if (_.isArray(imageObject[imageIconPath])) {
// before img success
imageObject[imageIconPath].push(d3.select(that));
} else {
d3.select(that).attr("xlink:href", imageObject[imageIconPath]);
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
return imageObject[imageIconPath];
}
}
}) })
.attr("x", "4") .attr("x", "4")
.attr("y", currentNode ? "3" : "4").attr("width", "40") .attr("y", currentNode ? "3" : "4").attr("width", "40")
......
...@@ -599,8 +599,7 @@ define(['require', ...@@ -599,8 +599,7 @@ define(['require',
var imagePath = options.imagePath, var imagePath = options.imagePath,
ajaxOptions = { ajaxOptions = {
"url": imagePath, "url": imagePath,
"method": "get", "method": "get"
"async": false,
} }
if (platform.name !== "IE") { if (platform.name !== "IE") {
...@@ -619,29 +618,17 @@ define(['require', ...@@ -619,29 +618,17 @@ define(['require',
} else { } else {
imageObject[imageIconPath] = imagePath; imageObject[imageIconPath] = imagePath;
} }
d3.select(that).attr("xlink:href", imageObject[imageIconPath]);
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
} }
}); });
} }
if (_.keys(imageObject).indexOf(imageIconPath) === -1) {
getImageData({ getImageData({
"imagePath": imageIconPath "imagePath": imageIconPath
}); });
} }
if (_.isUndefined(imageObject[imageIconPath])) {
// before img success
imageObject[imageIconPath] = [d3.select(that)];
} else if (_.isArray(imageObject[imageIconPath])) {
// before img success
imageObject[imageIconPath].push(d3.select(that));
} else {
d3.select(that).attr("xlink:href", imageObject[imageIconPath]);
if (imageIconPath !== shapeSvg.attr("data-iconpath")) {
shapeSvg.attr("data-iconpathorigin", imageIconPath);
}
return imageObject[imageIconPath];
}
}
}) })
.attr("x", "4") .attr("x", "4")
.attr("y", currentNode ? "3" : "4").attr("width", "40") .attr("y", currentNode ? "3" : "4").attr("width", "40")
......
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