mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-19 00:48:46 +02:00
Remove document event listeners:
No longer needed.
This commit is contained in:
parent
4e7335f149
commit
a986871dec
1 changed files with 9 additions and 30 deletions
|
@ -1,11 +1,11 @@
|
||||||
//
|
//
|
||||||
// createGlobalEventBridge.js
|
// createGlobalEventBridge.js
|
||||||
//
|
//
|
||||||
// Created by Anthony J. Thibault on 9/7/2016
|
// Created by Anthony J. Thibault on 9/7/2016
|
||||||
// Copyright 2016 High Fidelity, Inc.
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
// Stick a EventBridge object in the global namespace.
|
// Stick a EventBridge object in the global namespace.
|
||||||
|
@ -25,37 +25,16 @@ var EventBridge;
|
||||||
this.emitWebEvent = function (message) {
|
this.emitWebEvent = function (message) {
|
||||||
self._messages.push(message);
|
self._messages.push(message);
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
EventBridge = new TempEventBridge();
|
EventBridge = new TempEventBridge();
|
||||||
|
|
||||||
var webChannel = new QWebChannel(qt.webChannelTransport, function (channel) {
|
var webChannel = new QWebChannel(qt.webChannelTransport, (channel) => {
|
||||||
|
//
|
||||||
// replace the TempEventBridge with the real one.
|
// replace the TempEventBridge with the real one.
|
||||||
var tempEventBridge = EventBridge;
|
var tempEventBridge = EventBridge;
|
||||||
EventBridge = channel.objects.eventBridge;
|
EventBridge = channel.objects.eventBridge;
|
||||||
|
|
||||||
// To be able to update the state of the output device selection for every element added to the DOM
|
|
||||||
// we need to listen to events that might precede the addition of this elements.
|
|
||||||
// A more robust hack will be to add a setInterval that look for DOM changes every 100-300 ms (low performance?)
|
|
||||||
|
|
||||||
window.addEventListener("load",function(event) {
|
|
||||||
setTimeout(function() {
|
|
||||||
// EventBridge.forceHtmlAudioOutputDeviceUpdate();
|
|
||||||
}, 1200);
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
document.addEventListener("click",function(){
|
|
||||||
setTimeout(function() {
|
|
||||||
// EventBridge.forceHtmlAudioOutputDeviceUpdate();
|
|
||||||
}, 1200);
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
document.addEventListener("change",function(){
|
|
||||||
setTimeout(function() {
|
|
||||||
// EventBridge.forceHtmlAudioOutputDeviceUpdate();
|
|
||||||
}, 1200);
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
tempEventBridge._callbacks.forEach(function (callback) {
|
tempEventBridge._callbacks.forEach(function (callback) {
|
||||||
EventBridge.scriptEventReceived.connect(callback);
|
EventBridge.scriptEventReceived.connect(callback);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue