Remove unecessary event-related code from Util

The event-related wrapper functions in Util existed mainly for
backwards-compat.  However, all currently supported browsers
support the standard functions, so these wrappers are no longer needed.
This commit is contained in:
Solly Ross
2016-09-03 14:06:42 -04:00
parent e4fef7be2d
commit b4ef49ea36
4 changed files with 42 additions and 74 deletions
+7 -7
View File
@@ -142,7 +142,7 @@ var UI;
UI.setViewClip();
UI.setBarPosition();
Util.addEvent(window, 'resize', function () {
window.addEventListener('resize', function () {
UI.applyResizeMode();
UI.setViewClip();
UI.updateViewDrag();
@@ -160,17 +160,17 @@ var UI;
document.documentElement.webkitRequestFullscreen ||
document.body.msRequestFullscreen)) {
document.getElementById('noVNC_fullscreen_button').style.display = "inline";
Util.addEvent(window, 'fullscreenchange', UI.updateFullscreenButton);
Util.addEvent(window, 'mozfullscreenchange', UI.updateFullscreenButton);
Util.addEvent(window, 'webkitfullscreenchange', UI.updateFullscreenButton);
Util.addEvent(window, 'msfullscreenchange', UI.updateFullscreenButton);
window.addEventListener('fullscreenchange', UI.updateFullscreenButton);
window.addEventListener('mozfullscreenchange', UI.updateFullscreenButton);
window.addEventListener('webkitfullscreenchange', UI.updateFullscreenButton);
window.addEventListener('msfullscreenchange', UI.updateFullscreenButton);
}
Util.addEvent(window, 'load', UI.keyboardinputReset);
window.addEventListener('load', UI.keyboardinputReset);
// While connected we want to display a confirmation dialogue
// if the user tries to leave the page
Util.addEvent(window, 'beforeunload', function (e) {
window.addEventListener('beforeunload', function (e) {
if (UI.rfb && UI.rfb_state === 'normal') {
var msg = "You are currently connected.";
e.returnValue = msg;