Replace MooTools usage for adding window event listeners (#2429)

This commit is contained in:
Matt N 2019-01-21 08:14:32 -08:00 committed by Isaac Connor
parent 27bcf3f994
commit 19c272061a
19 changed files with 23 additions and 27 deletions

View File

@ -51,16 +51,14 @@ var Overlay = new Class({
},
show: function() {
this.mask.show();
$(window).addEvent( 'resize', this.update.bind(this) );
$(window).addEvent( 'scroll', this.update.bind(this) );
window.addEventListener( 'resize', this.update.bind(this) );
window.addEventListener( 'scroll', this.update.bind(this) );
this.element.tween( 'opacity', [0, 1.0] );
this.element.show();
this.element.position();
this.mask.position();
},
hideComplete: function() {
$(window).removeEvent( 'resize', this.update.bind(this) );
$(window).removeEvent( 'scroll', this.update.bind(this) );
this.element.hide();
this.mask.hide();
},
@ -82,12 +80,10 @@ var Overlay = new Class({
}
updateOverlayLoading();
this.loading.setStyle( 'display', 'block' );
$(window).addEvent( 'resize', this.update.bind(this) );
$(window).addEvent( 'scroll', this.update.bind(this) );
window.addEventListener( 'resize', this.update.bind(this) );
window.addEventListener( 'scroll', this.update.bind(this) );
},
hideAnimation: function() {
$(window).removeEvent( 'resize', this.update.bind(this) );
$(window).removeEvent( 'scroll', this.update.bind(this) );
if ( this.loading ) {
this.loading.setStyle( 'display', 'none' );
}
@ -119,4 +115,4 @@ function setupOverlays() {
}
}
window.addEvent( 'domready', setupOverlays );
window.addEventListener( 'DOMContentLoaded', setupOverlays );

View File

@ -384,7 +384,7 @@ if ( closePopup ) {
closeWindow();
}
window.addEvent( 'domready', checkSize );
window.addEventListener( 'DOMContentLoaded', checkSize );
function convertLabelFormat(LabelFormat, monitorName) {
//convert label format from strftime to moment's format (modified from

View File

@ -103,4 +103,4 @@ function initPage() {
probe(url);
}
}
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -146,4 +146,4 @@ function applySort(event, ui) {
ajax.send();
} // end function applySort(event,ui)
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -9,4 +9,4 @@ function updateLabel() {
form.newLabel.value = '';
}
}
window.addEvent('domready', updateLabel);
window.addEventListener('DOMContentLoaded', updateLabel);

View File

@ -6,4 +6,4 @@ function initCycle() {
nextCycleView.periodical(cycleRefreshTimeout);
}
window.addEvent('domready', initCycle);
window.addEventListener('DOMContentLoaded', initCycle);

View File

@ -35,4 +35,4 @@ function initPage() {
}
}
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -1068,4 +1068,4 @@ function initPage() {
}
// Kick everything off
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -51,4 +51,4 @@ function initPage() {
}
}
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -254,4 +254,4 @@ function init() {
$j("#sortTable [name$='sort_field\\]']").chosen();
}
window.addEvent( 'domready', init );
window.addEventListener( 'DOMContentLoaded', init );

View File

@ -314,4 +314,4 @@ function initPage() {
}
// Kick everything off
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -1,4 +1,4 @@
window.addEvent( 'domready', function() {
window.addEventListener( 'DOMContentLoaded', function() {
if ( failed == true ) {
$('loginError').removeClass( 'hidden' );
}

View File

@ -48,4 +48,4 @@ function initPage() {
//updateMethods( $(protocolSelector) );
}
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -447,4 +447,4 @@ function initPage() {
}
}
// Kick everything off
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -943,4 +943,4 @@ function initPage() {
}
window.addEventListener("resize", redrawScreen, {passive: true});
// Kick everything off
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -19,4 +19,4 @@ function initPage() {
return ( true );
}
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -56,4 +56,4 @@ function initPage() {
});
}
// Kick everything off
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );

View File

@ -775,4 +775,4 @@ function initPage() {
}
// Kick everything off
window.addEvent('domready', initPage);
window.addEventListener('DOMContentLoaded', initPage);

View File

@ -733,4 +733,4 @@ function Polygon_calcArea( coords ) {
return Math.round( Math.abs( float_area ) );
}
window.addEvent( 'domready', initPage );
window.addEventListener( 'DOMContentLoaded', initPage );