@tsparticles/editor
Version:
tsParticles Configuration Editor
50 lines (49 loc) • 2.16 kB
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", "object-gui", "./ClickEventsOptionsEditor", "./DivsEventsOptionsEditor", "../../../../EditorBase", "./HoverEventsOptionsEditor"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventsOptionsEditor = void 0;
const object_gui_1 = require("object-gui");
const ClickEventsOptionsEditor_1 = require("./ClickEventsOptionsEditor");
const DivsEventsOptionsEditor_1 = require("./DivsEventsOptionsEditor");
const EditorBase_1 = require("../../../../EditorBase");
const HoverEventsOptionsEditor_1 = require("./HoverEventsOptionsEditor");
class EventsOptionsEditor extends EditorBase_1.EditorBase {
constructor(particles) {
super(particles);
}
addToGroup(parent) {
this.group = parent.addGroup("events", "Events");
this.options = this.group.data;
this.addClick();
this.addDivs();
this.addHover();
this.addProperties();
}
addClick() {
const clickEditor = new ClickEventsOptionsEditor_1.ClickEventsOptionsEditor(this.particles);
clickEditor.addToGroup(this.group);
}
addDivs() {
const divsEditor = new DivsEventsOptionsEditor_1.DivsEventsOptionsEditor(this.particles);
divsEditor.addToGroup(this.group);
}
addHover() {
const hoverEditor = new HoverEventsOptionsEditor_1.HoverEventsOptionsEditor(this.particles);
hoverEditor.addToGroup(this.group);
}
addProperties() {
this.group.addProperty("resize", "Resize", object_gui_1.EditorType.boolean).change(() => {
void this.particles().refresh();
});
}
}
exports.EventsOptionsEditor = EventsOptionsEditor;
});