mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-15 06:16:14 +00:00
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:
@@ -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');
|
||||
|
||||
|
Reference in New Issue
Block a user