mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 23:39:50 +02:00
Update _id
to id
This commit is contained in:
@@ -209,19 +209,18 @@ export const updateLink = function (positions, style) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const addClass = function (ids, style) {
|
export const addClass = function (ids, style) {
|
||||||
ids.split(',').forEach(function (_id) {
|
ids.split(',').forEach(function (id) {
|
||||||
if (classes[_id] === undefined) {
|
if (classes[id] === undefined) {
|
||||||
classes[_id] = { id: _id, styles: [], textStyles: [] };
|
classes[id] = { id, styles: [], textStyles: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (style !== undefined && style !== null) {
|
if (style) {
|
||||||
style.forEach(function (s) {
|
style.forEach(function (s) {
|
||||||
if (s.match('color')) {
|
if (s.match('color')) {
|
||||||
const newStyle1 = s.replace('fill', 'bgFill');
|
const newStyle = s.replace('fill', 'bgFill').replace('color', 'fill');
|
||||||
const newStyle2 = newStyle1.replace('color', 'fill');
|
classes[id].textStyles.push(newStyle);
|
||||||
classes[_id].textStyles.push(newStyle2);
|
|
||||||
}
|
}
|
||||||
classes[_id].styles.push(s);
|
classes[id].styles.push(s);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user