2023-02-17 11:06:01 +01:00

42 lines
1.3 KiB
JavaScript

(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "../../Utils/Utils"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Responsive = void 0;
const Utils_1 = require("../../Utils/Utils");
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 = (0, Utils_1.deepExtend)({}, data.options);
}
}
}
exports.Responsive = Responsive;
});