mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
parent
bd545fd5b2
commit
40027dd502
@ -941,7 +941,7 @@ define('pgadmin.misc.explain', [
|
|||||||
|
|
||||||
drawImage: function(
|
drawImage: function(
|
||||||
g, image_content, currentXpos, currentYpos, graphContainer,
|
g, image_content, currentXpos, currentYpos, graphContainer,
|
||||||
toolTipContainer, downloadSVG=false
|
toolTipContainer, downloadSVGFile=false
|
||||||
) {
|
) {
|
||||||
// Draw the actual image for current node
|
// Draw the actual image for current node
|
||||||
var image = g.image(
|
var image = g.image(
|
||||||
@ -960,7 +960,7 @@ define('pgadmin.misc.explain', [
|
|||||||
var image_data = this.toJSON(),
|
var image_data = this.toJSON(),
|
||||||
nodeLabel = this.getLabel();
|
nodeLabel = this.getLabel();
|
||||||
|
|
||||||
if (downloadSVG) {
|
if (downloadSVGFile) {
|
||||||
var title = '<title>';
|
var title = '<title>';
|
||||||
_.each(image_data, function (value, key) {
|
_.each(image_data, function (value, key) {
|
||||||
if (
|
if (
|
||||||
@ -982,48 +982,6 @@ define('pgadmin.misc.explain', [
|
|||||||
|
|
||||||
image.append(Snap.parse(title));
|
image.append(Snap.parse(title));
|
||||||
|
|
||||||
image.mouseover(() => {
|
|
||||||
// Empty the tooltip content if it has any and add new data
|
|
||||||
let toolTipBody = toolTipContainer.find('.details-body');
|
|
||||||
let toolTipTitle = toolTipContainer.find('.details-title');
|
|
||||||
toolTipTitle.text(nodeLabel);
|
|
||||||
|
|
||||||
toolTipBody.empty();
|
|
||||||
|
|
||||||
// Remove the title content so that we can show our custom build tooltips.
|
|
||||||
image.node.textContent = '';
|
|
||||||
|
|
||||||
var tooltipTable = $(`
|
|
||||||
<table class='pgadmin-tooltip-table table table-bordered table-noouter-border table-bottom-border table-hover'>
|
|
||||||
<tbody></tbody>
|
|
||||||
</table>`).appendTo(toolTipBody);
|
|
||||||
var tooltip = tooltipTable.find('tbody');
|
|
||||||
|
|
||||||
_.each(image_data, function (value, key) {
|
|
||||||
if (
|
|
||||||
key !== 'image' &&
|
|
||||||
key !== 'Plans' &&
|
|
||||||
key !== 'level' &&
|
|
||||||
key !== 'image' &&
|
|
||||||
key !== 'image_text' &&
|
|
||||||
key !== 'xpos' &&
|
|
||||||
key !== 'ypos' &&
|
|
||||||
key !== 'width' &&
|
|
||||||
key !== 'height'
|
|
||||||
) {
|
|
||||||
key = _.escape(key);
|
|
||||||
value = _.escape(value);
|
|
||||||
tooltip.append(`
|
|
||||||
<tr>
|
|
||||||
<td class='label explain-tooltip'>${key}</td>
|
|
||||||
<td class='label explain-tooltip-val'>${value}</td>
|
|
||||||
</tr>
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
toolTipContainer.removeClass('d-none');
|
|
||||||
toolTipBody.scrollTop(0);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
image.click(() => {
|
image.click(() => {
|
||||||
@ -1104,11 +1062,11 @@ define('pgadmin.misc.explain', [
|
|||||||
var onSVGLoaded = function(data) {
|
var onSVGLoaded = function(data) {
|
||||||
var svg_image = Snap();
|
var svg_image = Snap();
|
||||||
svg_image.append(data);
|
svg_image.append(data);
|
||||||
var downloadSVG = true;
|
var downloadSVGFile = true;
|
||||||
|
|
||||||
that.drawImage(
|
that.drawImage(
|
||||||
g, svg_image.toDataURL(), startX, startY, graphContainer,
|
g, svg_image.toDataURL(), startX, startY, graphContainer,
|
||||||
toolTipContainer, downloadSVG
|
toolTipContainer, downloadSVGFile
|
||||||
);
|
);
|
||||||
|
|
||||||
// This attribute is required to download the file as SVG image.
|
// This attribute is required to download the file as SVG image.
|
||||||
|
Loading…
Reference in New Issue
Block a user