wisemapping-frontend/packages/mindplot/lib/components/Options.js

18 lines
445 B
JavaScript
Raw Normal View History

2021-07-16 16:41:58 +02:00
const Options = new Class({
2021-10-05 02:05:34 +02:00
setOptions() {
const options = this.options = Object.merge.apply(null, [{}, this.options].append(arguments));
if (this.addEvent) {
for (const option in options) {
if (typeOf(options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue;
this.addEvent(option, options[option]);
delete options[option];
}
2021-07-16 16:41:58 +02:00
}
2021-10-05 02:05:34 +02:00
return this;
},
2021-07-16 16:41:58 +02:00
});
export default Options;