Shave off some bytes (#8362)

This commit is contained in:
Jukka Kurkela 2021-02-01 15:39:43 +02:00 committed by GitHub
parent 49b0916c19
commit 2890b7022b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 15 deletions

View File

@ -323,10 +323,7 @@ class Chart {
me.scales = scales;
each(scales, (scale) => {
// Set LayoutItem parameters for backwards compatibility
scale.fullSize = scale.options.fullSize;
scale.position = scale.options.position;
scale.weight = scale.options.weight;
layouts.configure(me, scale, scale.options);
layouts.addBox(me, scale);
});
}

View File

@ -284,17 +284,9 @@ export default {
* @param {object} options - the new item options.
*/
configure(chart, item, options) {
const props = ['fullSize', 'position', 'weight'];
const ilen = props.length;
let i = 0;
let prop;
for (; i < ilen; ++i) {
prop = props[i];
if (Object.prototype.hasOwnProperty.call(options, prop)) {
item[prop] = options[prop];
}
}
item.fullSize = options.fullSize;
item.position = options.position;
item.weight = options.weight;
},
/**