mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Shave off some bytes (#8362)
This commit is contained in:
parent
49b0916c19
commit
2890b7022b
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@ -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;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user