Skip to content

Commit

Permalink
21.8.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Sep 24, 2023
1 parent ec5dcc2 commit dd9027c
Show file tree
Hide file tree
Showing 17 changed files with 4,558 additions and 4,451 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
24-SEP-2023: 21.8.2

- Confirm escape key for insert layout [drawio-3880]
- Scrolls cell to visible after remove from group

22-SEP-2023: 21.8.1

- Attempt to fix NPE in GraphViewer
- [conf cloud] Fixed custom templates loading in the editor [DID-9482]
- [conf cloud] Prevent calling theme callback multiple times for the same event [DID-9505]
- Fixes independent drag of cell with part=1 [DS-950]

20-SEP-2023: 21.8.0

- Ports Cache servlet to AWS Lambda [TI-11]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.8.0
21.8.2
Binary file not shown.
2,263 changes: 1,134 additions & 1,129 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

14 changes: 2 additions & 12 deletions src/main/webapp/js/diagramly/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,12 +1478,6 @@ var CreateGraphDialog = function(editorUi, title, type)
{
editorUi.confirm(mxResources.get('areYouSure'), function()
{
if (container.parentNode != null)
{
graph.destroy();
container.parentNode.removeChild(container);
}

editorUi.hideDialog();
});
})
Expand Down Expand Up @@ -1516,12 +1510,6 @@ var CreateGraphDialog = function(editorUi, title, type)
editorUi.editor.graph.setSelectionCells(cells);
}

if (container.parentNode != null)
{
graph.destroy();
container.parentNode.removeChild(container);
}

editorUi.hideDialog();
});

Expand All @@ -1532,6 +1520,8 @@ var CreateGraphDialog = function(editorUi, title, type)
{
div.appendChild(cancelBtn);
}

this.graph = graph;
};

this.container = div;
Expand Down
6 changes: 2 additions & 4 deletions src/main/webapp/js/diagramly/GraphViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)
if (this.responsive && this.graph.dialect == mxConstants.DIALECT_SVG)
{
var root = this.graph.view.getDrawPane().ownerSVGElement;
var canvas = this.graph.view.getCanvas();

if (this.graphConfig.border != null)
{
Expand Down Expand Up @@ -301,7 +300,7 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)

if (diagrams.length > 0)
{
//Find the page index if the pageId is provided
// Finds index for given page ID
if (this.pageId != null)
{
for (var i = 0; i < diagrams.length; i++)
Expand All @@ -315,8 +314,7 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)
}

var graphGetGlobalVariable = this.graph.getGlobalVariable;
var self = this;


this.graph.getGlobalVariable = function(name)
{
var diagram = diagrams[self.currentPage];
Expand Down
25 changes: 24 additions & 1 deletion src/main/webapp/js/diagramly/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -3642,7 +3642,30 @@
else
{
var dlg = new CreateGraphDialog(editorUi, title, method);
editorUi.showDialog(dlg.container, 620, 420, true, false);
editorUi.showDialog(dlg.container, 620, 420, true, false, function(cancel, isEsc)
{
if (isEsc)
{
editorUi.confirm(mxResources.get('areYouSure'), function()
{
editorUi.hideDialog();
});

return false;
}
else if (dlg.graph != null)
{
if (dlg.graph.container.parentNode != null)
{
dlg.graph.container.parentNode.
removeChild(dlg.graph.container);
}

dlg.graph.destroy();
dlg.graph = null;
}
});

// Executed after dialog is added to dom
dlg.init();
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/webapp/js/grapheditor/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,11 @@ Actions.prototype.init = function()
}

graph.removeCellsFromParent(temp);

if (temp.length > 0)
{
graph.scrollCellToVisible(temp[0]);
}
}
}
});
Expand Down
13 changes: 10 additions & 3 deletions src/main/webapp/js/grapheditor/EditorUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -5520,14 +5520,21 @@ EditorUi.prototype.hideDialog = function(cancel, isEsc, matchContainer)
}

var dlg = this.dialogs.pop();

// Temporary override to restore order of dialogs
// if dialogs are added in the close callback
var temp = this.dialogs.slice();
this.dialogs = [];

if (dlg.close(cancel, isEsc) == false)
{
//add the dialog back if dialog closing is cancelled
this.dialogs.push(dlg);
// Adds the dialog back if dialog closing is cancelled
this.dialogs = temp.concat(dlg).concat(this.dialogs);

return;
}


this.dialogs = temp;
this.dialog = (this.dialogs.length > 0) ? this.dialogs[this.dialogs.length - 1] : null;
this.editor.fireEvent(new mxEventObject('hideDialog'));

Expand Down
70 changes: 60 additions & 10 deletions src/main/webapp/js/grapheditor/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -2816,7 +2816,6 @@ Graph.prototype.init = function(container)
};
}


// Adds or updates CSS for flowAnimation style
this.addListener(mxEvent.SIZE, mxUtils.bind(this, function(sender, evt)
{
Expand Down Expand Up @@ -6215,15 +6214,17 @@ Graph.prototype.getFlowAnimationStyle = function()
/**
* Adds rack child layout style.
*/
Graph.prototype.getFlowAnimationStyleCss = function(id)
Graph.prototype.getFlowAnimationStyleCss = function(id, scale)
{
scale = (scale != null) ? scale : this.view.scale;

return '.' + id + ' {\n' +
'animation: ' + id + ' 0.5s linear;\n' +
'animation-iteration-count: infinite;\n' +
'}\n' +
'@keyframes ' + id + ' {\n' +
'to {\n' +
'stroke-dashoffset: ' + (this.view.scale * -16) + ';\n' +
'stroke-dashoffset: ' + (scale * -16) + ';\n' +
'}\n' +
'}';
};
Expand Down Expand Up @@ -11452,7 +11453,6 @@ if (typeof mxVertexHandler !== 'undefined')
svgCanvas.textEnabled = showText;

imgExport = (imgExport != null) ? imgExport : this.createSvgImageExport();
var imgExportDrawCellState = imgExport.drawCellState;

// Ignores custom links
var imgExportGetLinkForCellState = imgExport.getLinkForCellState;
Expand All @@ -11468,8 +11468,10 @@ if (typeof mxVertexHandler !== 'undefined')
{
return state.view.graph.getLinkTargetForCell(state.cell);
};

// Implements ignoreSelection flag

// Implements ignoreSelection flag and flow animation
var imgExportDrawCellState = imgExport.drawCellState;

imgExport.drawCellState = function(state, canvas)
{
var graph = state.view.graph;
Expand All @@ -11485,13 +11487,53 @@ if (typeof mxVertexHandler !== 'undefined')
graph.isCellSelected(parent);
parent = graph.model.getParent(parent);
}


// Adds flow animation
var prevStroke = canvas.stroke;

canvas.stroke = function()
{
if (this.root != null && this.node != null &&
this.node.nodeName == 'path' &&
graph.enableFlowAnimation &&
graph.model.isEdge(state.cell) &&
mxUtils.getValue(state.style, 'flowAnimation', '0') == '1')
{
if (imgExport.flowAnimationStyle == null)
{
var id = 'ge-export-svg-flow-animation';
var svgDoc = this.root.ownerDocument;
var style = (svgDoc.createElementNS != null) ?
svgDoc.createElementNS(mxConstants.NS_SVG, 'style') :
svgDoc.createElement('style');
svgDoc.setAttributeNS != null? style.setAttributeNS('type', 'text/css') :
style.setAttribute('type', 'text/css');
style.innerHTML = graph.getFlowAnimationStyleCss(id, scale);
style.setAttribute('id', id);
svgDoc.getElementsByTagName('defs')[0].appendChild(style);

imgExport.flowAnimationStyle = style;
}

if (mxUtils.getValue(this.state.style, mxConstants.STYLE_DASHED, '0') != '1')
{
this.node.setAttribute('stroke-dasharray', (scale * 8));
}

this.node.setAttribute('class', imgExport.flowAnimationStyle.getAttribute('id'));
}

prevStroke.apply(this, arguments);
};

if ((ignoreSelection && lookup == null) || selected)
{
graph.view.redrawEnumerationState(state);
imgExportDrawCellState.apply(this, arguments);
this.doDrawShape(state.secondLabel, canvas);
}

canvas.stroke = prevStroke;
};

var viewRoot = (this.view.currentRoot != null) ?
Expand Down Expand Up @@ -14412,7 +14454,7 @@ if (typeof mxVertexHandler !== 'undefined')
/**
* Updates the hint for the current operation.
*/
mxEdgeHandler.prototype.updateHint = function(me, point)
mxEdgeHandler.prototype.updateHint = function(me, point, edge)
{
if (this.hint == null)
{
Expand All @@ -14425,10 +14467,18 @@ if (typeof mxVertexHandler !== 'undefined')
var x = this.roundLength(point.x / s - t.x);
var y = this.roundLength(point.y / s - t.y);
var unit = this.graph.view.unit;

this.hint.innerHTML = formatHintText(x, unit) + ', ' + formatHintText(y, unit);
this.hint.style.visibility = 'visible';


if (edge != null)
{
edge.view.updateEdgeBounds(edge);
this.hint.innerHTML += ' (' + ((unit == mxConstants.POINTS) ?
Math.round(edge.length / s) : formatHintText(
edge.length / s, unit)) + ')';
}

if (this.isSource || this.isTarget)
{
if (this.constraintHandler != null &&
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/grapheditor/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ Sidebar.prototype.addSearchPalette = function(expand)

mxEvent.addListener(input, 'keydown', mxUtils.bind(this, function(evt)
{
if (evt.keyCode == 13 /* Enter */ || evt.keyCode == 229 /* Next on Android */)
if (evt.keyCode == 13 /* Enter */)
{
find();
mxEvent.consume(evt);
Expand Down
Loading

0 comments on commit dd9027c

Please sign in to comment.