Commit da13d53a by gutkaBinit Committed by nixonrodrigues

ATLAS-3213 UI : Png export not working in Safari Browser.

parent 37b489ff
......@@ -603,10 +603,13 @@ define(['require',
}
});
}
getImageData({
"imagePath": imagePath,
"imageIconPath": imageIconPath
});
if (_.keys(imageObject).indexOf(imageIconPath) === -1) {
getImageData({
"imagePath": imagePath,
"imageIconPath": imageIconPath
});
}
if (_.isUndefined(imageObject[imageIconPath])) {
// before img success
imageObject[imageIconPath] = [d3.select(that)];
......@@ -755,6 +758,7 @@ define(['require',
return;
}
that.$('svg').removeClass('hover');
that.$('svg').removeClass('hover-active');
LineageUtils.onHoverFade({
opacity: 1,
selectedNode: d,
......@@ -825,39 +829,17 @@ define(['require',
}
}).init();
zoom.event(svg);
// console.log(this.$('svg')[0].getBBox())
//svg.attr('height', this.g.graph().height * initialScale + 40);
if (platform.name === "IE") {
LineageUtils.refreshGraphForIE({
edgeEl: this.$('svg .edgePath')
});
// this.$('svg .edgePath').each(function(argument) {
// var childNode = $(this).find('marker');
// console.log(childNode);
// $(this).find('marker').remove();
// var eleRef = this;
// ++that.IEGraphRenderDone;
// setTimeout(function(argument) {
// $(eleRef).find('defs').append(childNode);
// --that.IEGraphRenderDone;
// if (that.IEGraphRenderDone === 0) {
// this.$('.fontLoader').hide();
// this.$('svg').fadeTo(1000, 1)
// }
// }, 1000);
// });
}
// console.log(platform.name)
// if (platform.name !== "IE") {
LineageUtils.DragNode({
svg: this.svg,
g: this.g,
guid: this.guid,
edgeEl: this.$('svg .edgePath')
}).init();
// }
},
renderLineageTypeSearch: function() {
var that = this,
......@@ -987,7 +969,7 @@ define(['require',
scaleFactor = 1,
svgWidth = that.$('svg').width(),
svgHeight = that.$('svg').height();
if (platform.name != "Chrome") {
if (platform.name === "Firefox") {
svgClone.setAttribute('width', svgWidth);
svgClone.setAttribute('height', svgHeight);
}
......@@ -1020,6 +1002,9 @@ define(['require',
var img = new Image(canvas.width, canvas.height);
var svgBlob = new Blob([data], { type: 'image/svg+xml;base64' });
if (platform.name === "Safari") {
svgBlob = new Blob([data], { type: 'image/svg+xml' });
}
var url = DOMURL.createObjectURL(svgBlob);
img.onload = function() {
......@@ -1045,6 +1030,11 @@ define(['require',
}
a.click();
that.toggleLoader(loaderTargetDiv);
if (platform.name === 'Safari') {
LineageUtils.refreshGraphForSafari({
edgeEl: that.$('svg g.node')
});
}
}, 'image/png');
$('.hidden-svg').html('');
createCanvas.remove();
......
......@@ -63,7 +63,6 @@ define(['require', ''], function(require) {
nodeDrag.call(svg.selectAll("g.node"));
edgeDrag.call(svg.selectAll("g.edgePath"));
// this.refreshGraphForIE();
},
dragstart: function(d) {
d3.event.sourceEvent.stopPropagation();
......@@ -159,9 +158,18 @@ define(['require', ''], function(require) {
},
}
}
LinegaeUtils.refreshGraphForSafari = function(options) {
var edgePathEl = options.edgeEl,
IEGraphRenderDone = 0;
edgePathEl.each(function(argument) {
var eleRef = this,
childNode = $(this).find('pattern');
setTimeout(function(argument) {
$(eleRef).find('defs').append(childNode);
}, 500);
});
}
LinegaeUtils.refreshGraphForIE = function(options) {
var edgePathEl = options.edgeEl,
IEGraphRenderDone = 0;
edgePathEl.each(function(argument) {
......
......@@ -318,7 +318,7 @@ define(['require',
var that = this,
notifyObj = {
modal: true,
text: "It looks like you have been edited something. If you leave before saving, your changes will be lost.",
text: "It looks like you have edited something. If you leave before saving, your changes will be lost.",
ok: function(argument) {
that.viewType = that.ui.editPropagationType.is(":checked") ? "flow" : "table";
that.ui.editPropagationType.prop("checked", that.viewType === "flow" ? false : true).trigger("change");
......
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