Changeset 9602
- Timestamp:
- 03/18/2020 04:31:40 AM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
r9601 r9602 24 24 25 25 wp_enqueue_script( 'wporg-support-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20181209', true ); 26 wp_enqueue_script( 'wporg-support-forums', get_template_directory_uri() . '/js/forums.js', array( 'jquery' ), '20 180801', true );26 wp_enqueue_script( 'wporg-support-forums', get_template_directory_uri() . '/js/forums.js', array( 'jquery' ), '20200318', true ); 27 27 } 28 28 add_action( 'wp_enqueue_scripts', 'wporg_support_scripts' ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/js/forums.js
r7519 r9602 1 1 ( function( $ ) { 2 if ( $( '#new-post' ).length ) { 3 var 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 ) );
Note: See TracChangeset
for help on using the changeset viewer.