Merge remote-tracking branch 'ups/v3' into 898_explicit_typings
This commit is contained in:
+7
-4
@@ -473,7 +473,8 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
||||
this.viewport.syncScrollArea();
|
||||
break;
|
||||
case 'tabStopWidth': this.setupStops(); break;
|
||||
case 'bellStyle': this.preloadBellSound(); break;
|
||||
case 'bellSound':
|
||||
case 'bellStyle': this.syncBellSound(); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -683,7 +684,7 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
||||
this.viewportElement.appendChild(this.viewportScrollArea);
|
||||
|
||||
// preload audio
|
||||
this.preloadBellSound();
|
||||
this.syncBellSound();
|
||||
|
||||
// Create the selection container.
|
||||
this.selectionContainer = document.createElement('div');
|
||||
@@ -2270,8 +2271,10 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
||||
this.options.bellStyle === 'both';
|
||||
}
|
||||
|
||||
private preloadBellSound(): void {
|
||||
if (this.soundBell()) {
|
||||
private syncBellSound(): void {
|
||||
if (this.soundBell() && this.bellAudioElement) {
|
||||
this.bellAudioElement.setAttribute('src', this.options.bellSound);
|
||||
} else if (this.soundBell()) {
|
||||
this.bellAudioElement = document.createElement('audio');
|
||||
this.bellAudioElement.setAttribute('preload', 'auto');
|
||||
this.bellAudioElement.setAttribute('src', this.options.bellSound);
|
||||
|
||||
Reference in New Issue
Block a user