#104 extend jquery convert to javascript

master
Agriya Dev5 2021-05-24 12:38:46 +05:30
parent 78b5ea1010
commit 2a0666aa1c
3 changed files with 4 additions and 4 deletions

View File

@ -402,7 +402,6 @@ export default class ConfigObj {
*/
const extendOrAdd = (cfgObj, key, val) => {
if (cfgObj[key] && typeof cfgObj[key] === 'object') {
// $.extend(true, cfgObj[key], val);
cfgObj[key] = mergeDeep(cfgObj[key], val);
} else {
cfgObj[key] = val;
@ -452,7 +451,6 @@ export default class ConfigObj {
} else if (this.defaultConfig[key] && typeof this.defaultConfig[key] === 'object') {
this.curConfig[key] = Array.isArray(this.defaultConfig[key]) ? [] : {};
this.curConfig[key] = mergeDeep(this.curConfig[key], val);
// $.extend(true, this.curConfig[key], val); // Merge properties recursively, e.g., on initFill, initStroke objects
} else {
this.curConfig[key] = val;
}

View File

@ -239,7 +239,8 @@ export const recalculateDimensions = function (selected) {
// if we haven't created an initial array in polygon/polyline/path, then
// make a copy of initial values and include the transform
if (isNullish(initial)) {
initial = $.extend(true, {}, changes);
const canvas = context_.getCanvas();
initial = canvas.mergeDeep({}, changes);
for (const [ attr, val ] of Object.entries(initial)) {
initial[attr] = convertToNum(attr, val);
}

View File

@ -480,7 +480,8 @@ class SvgCanvas {
getSVGRoot,
getStartTransform() { return startTransform; },
setStartTransform(transform) { startTransform = transform; },
getDataStorage
getDataStorage,
getCanvas() { return canvas; },
}
);
this.recalculateDimensions = recalculateDimensions;