Update `_id` to `id`

This commit is contained in:
Sidharth Vinod 2023-06-18 13:02:35 +05:30
parent bfa76af434
commit e3e12bbc78
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
1 changed files with 7 additions and 8 deletions

View File

@ -209,19 +209,18 @@ export const updateLink = function (positions, style) {
};
export const addClass = function (ids, style) {
ids.split(',').forEach(function (_id) {
if (classes[_id] === undefined) {
classes[_id] = { id: _id, styles: [], textStyles: [] };
ids.split(',').forEach(function (id) {
if (classes[id] === undefined) {
classes[id] = { id, styles: [], textStyles: [] };
}
if (style !== undefined && style !== null) {
if (style) {
style.forEach(function (s) {
if (s.match('color')) {
const newStyle1 = s.replace('fill', 'bgFill');
const newStyle2 = newStyle1.replace('color', 'fill');
classes[_id].textStyles.push(newStyle2);
const newStyle = s.replace('fill', 'bgFill').replace('color', 'fill');
classes[id].textStyles.push(newStyle);
}
classes[_id].styles.push(s);
classes[id].styles.push(s);
});
}
});