mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
refactor(html): update VolumeRange to use handleEvent pattern for consistency
Update HTML VolumeRange component to use the same generic handleEvent pattern as PlayButton and MuteButton components for architectural consistency. Changes: - Replace specific handleInput() method with generic handleEvent(event: Event) - Use event.type checking pattern consistent with other components - Pass 'this' as EventListener instead of bound method reference - Maintain exact same functionality while improving code consistency This ensures all HTML media components follow the same event handling pattern, making the codebase more maintainable and predictable. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
Christian Pillsbury
co-authored by
Claude
parent
75c6cb6bc3
commit
dad2fea986
@@ -23,13 +23,17 @@ export class VolumeRangeBase extends HTMLElement {
|
||||
this._input.min = '0';
|
||||
this._input.max = '1';
|
||||
this._input.step = '0.01';
|
||||
this._input.addEventListener('input', this.handleInput.bind(this));
|
||||
this._input.addEventListener('input', this);
|
||||
this.appendChild(this._input);
|
||||
}
|
||||
|
||||
handleInput() {
|
||||
if (this._state) {
|
||||
this._state.requestVolumeChange(parseFloat(this._input.value));
|
||||
handleEvent(event: Event) {
|
||||
const { type } = event;
|
||||
const state = this._state;
|
||||
if (state) {
|
||||
if (type === 'input') {
|
||||
state.requestVolumeChange(parseFloat(this._input.value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user