Move preloading bell audio to open() and append it the the terminal element

This commit is contained in:
npezza93
2017-08-16 20:39:26 -04:00
parent fd51d0acf3
commit 6b46e0837f
+8
View File
@@ -689,6 +689,14 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
this.viewportScrollArea.classList.add('xterm-scroll-area');
this.viewportElement.appendChild(this.viewportScrollArea);
// preload audio
if (this.options.bellSound) {
this.bellAudioElement = document.createElement('audio');
this.bellAudioElement.setAttribute('preload', 'auto');
this.bellAudioElement.setAttribute('src', this.options.bellSound);
this.element.appendChild(this.bellAudioElement);
}
// Create the selection container.
this.selectionContainer = document.createElement('div');
this.selectionContainer.classList.add('xterm-selection');