diff --git a/wordpress.org/public_html/wp-content/themes/pub/wporg-support/js/forums.js b/wordpress.org/public_html/wp-content/themes/pub/wporg-support/js/forums.js
index 657dfc1..f172535 100644
|
a
|
b
|
|
| 1 | 1 | ( function( $ ) { |
| | 2 | if ( $( '#new-post' ).length ) { |
| | 3 | let requireConfirmClose = false; |
| 2 | 4 | |
| 3 | | $( '#new-post' ).submit(function() { |
| 4 | | $( '[type="submit"]', $(this) ).prop( 'disabled', 'disabled' ); |
| 5 | | }); |
| | 5 | $( '#new-post' ).submit( function() { |
| | 6 | $( '[type="submit"]', $( this ) ).prop( 'disabled', 'disabled' ); |
| 6 | 7 | |
| 7 | | } )( window.jQuery ); |
| | 8 | requireConfirmClose = false; |
| | 9 | } ); |
| | 10 | |
| | 11 | $( '#new-post' ).one( 'input', 'input[type=text], textarea', function() { |
| | 12 | requireConfirmClose = true; |
| | 13 | } ); |
| | 14 | |
| | 15 | window.addEventListener( 'beforeunload', function( e ) { |
| | 16 | if ( requireConfirmClose ) { |
| | 17 | e.preventDefault(); |
| | 18 | |
| | 19 | // Chrome requires returnValue to be set. |
| | 20 | e.returnValue = ''; |
| | 21 | } |
| | 22 | } ); |
| | 23 | } |
| | 24 | }( window.jQuery ) ); |