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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user