28 lines
686 B
JavaScript
28 lines
686 B
JavaScript
import { deepExtend } from "../../Utils/Utils";
|
|
export class Responsive {
|
|
constructor() {
|
|
this.maxWidth = Infinity;
|
|
this.options = {};
|
|
this.mode = "canvas";
|
|
}
|
|
load(data) {
|
|
if (!data) {
|
|
return;
|
|
}
|
|
if (data.maxWidth !== undefined) {
|
|
this.maxWidth = data.maxWidth;
|
|
}
|
|
if (data.mode !== undefined) {
|
|
if (data.mode === "screen") {
|
|
this.mode = "screen";
|
|
}
|
|
else {
|
|
this.mode = "canvas";
|
|
}
|
|
}
|
|
if (data.options !== undefined) {
|
|
this.options = deepExtend({}, data.options);
|
|
}
|
|
}
|
|
}
|