chore: [security]: Finish up wrapping event listeners and other small fixes, b=(no-bug), c=configs, common, compact-mode, split-view, tabs, workspaces

This commit is contained in:
mr. m
2025-04-23 00:30:56 +02:00
parent 18b4925dd4
commit 6de445eaa1
11 changed files with 168 additions and 134 deletions

View File

@@ -35,6 +35,14 @@
this.onDarkModeChange.bind(this)
);
this.panel.addEventListener('popupshowing', this.handlePanelOpen.bind(this));
this.panel.addEventListener('popuphidden', this.handlePanelClose.bind(this));
this.panel.addEventListener('command', this.handlePanelCommand.bind(this));
document
.getElementById('PanelUI-zen-gradient-generator-opacity')
.addEventListener('input', this.onOpacityChange.bind(this));
this.initCanvas();
this.initCustomColorInput();
this.initTextureInput();
@@ -404,6 +412,18 @@
await this.updateCurrentWorkspace();
}
handlePanelCommand(event) {
const target = event.target.closest('toolbarbutton');
if (!target) {
return;
}
switch (target.id) {
case 'PanelUI-zen-gradient-generator-color-custom-add':
this.addCustomColor();
break;
}
}
spawnDot(relativePosition, primary = false) {
const dotPad = this.panel.querySelector('.zen-theme-picker-gradient');