penscratch-2.js 588 B

12345678910111213141516171819202122
  1. ( function () {
  2. 'use strict';
  3. function onPageLoad() {
  4. // Trigger resize event to make sure video widgets in the footer maintain the correct aspect ratio
  5. setTimeout( function () {
  6. if ( typeof Event === 'function' ) {
  7. window.dispatchEvent( new Event( 'resize' ) );
  8. } else {
  9. var event = window.document.createEvent( 'UIEvents' );
  10. event.initUIEvent( 'resize', true, false, window, 0 );
  11. window.dispatchEvent( event );
  12. }
  13. } );
  14. }
  15. if ( document.readyState === 'complete' ) {
  16. onPageLoad();
  17. } else {
  18. window.addEventListener( 'load', onPageLoad );
  19. }
  20. } )();