Changeset 44539
- Timestamp:
- 01/10/2019 02:56:24 AM (5 years ago)
- Location:
- trunk/src/js/_enqueues
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/user-profile.js
r43347 r44539 18 18 $submitButtons, 19 19 $submitButton, 20 currentPass, 21 inputEvent; 22 23 /* 24 * Use feature detection to determine whether password inputs should use 25 * the `keyup` or `input` event. Input is preferred but lacks support 26 * in legacy browsers. 27 */ 28 if ( 'oninput' in document.createElement( 'input' ) ) { 29 inputEvent = 'input'; 30 } else { 31 inputEvent = 'keyup'; 32 } 20 currentPass; 33 21 34 22 function generatePassword() { … … 72 60 .data( 'pw', $pass1.data( 'pw' ) ) 73 61 .val( $pass1.val() ) 74 .on( inputEvent, function () {62 .on( 'input', function () { 75 63 if ( $pass1Text.val() === currentPass ) { 76 64 return; … … 87 75 } 88 76 89 $pass1.on( inputEvent+ ' pwupdate', function () {77 $pass1.on( 'input' + ' pwupdate', function () { 90 78 if ( $pass1.val() === currentPass ) { 91 79 return; … … 189 177 * pass2 field to the pass1 field, then running check_pass_strength. 190 178 */ 191 $pass2 = $( '#pass2').on( inputEvent, function () {179 $pass2 = $( '#pass2' ).on( 'input', function () { 192 180 if ( $pass2.val().length > 0 ) { 193 181 $pass1.val( $pass2.val() ); … … 337 325 greeting = $( '#wp-admin-bar-my-account' ).find( '.display-name' ); 338 326 339 $( '#pass1').val('').on( inputEvent+ ' pwupdate', check_pass_strength );327 $( '#pass1' ).val( '' ).on( 'input' + ' pwupdate', check_pass_strength ); 340 328 $('#pass-strength-result').show(); 341 329 $('.color-palette').click( function() { -
trunk/src/js/_enqueues/lib/nav-menu.js
r43577 r44539 874 874 875 875 attachQuickSearchListeners : function() { 876 var searchTimer, 877 inputEvent; 876 var searchTimer; 878 877 879 878 // Prevent form submission. … … 882 881 }); 883 882 884 /* 885 * Use feature detection to determine whether inputs should use 886 * the `keyup` or `input` event. Input is preferred but lacks support 887 * in legacy browsers. See changeset 34078, see also ticket #26600#comment:59 888 */ 889 if ( 'oninput' in document.createElement( 'input' ) ) { 890 inputEvent = 'input'; 891 } else { 892 inputEvent = 'keyup'; 893 } 894 895 $( '#nav-menu-meta' ).on( inputEvent, '.quick-search', function() { 883 $( '#nav-menu-meta' ).on( 'input', '.quick-search', function() { 896 884 var $this = $( this ); 897 885 -
trunk/src/js/_enqueues/wp/customize/nav-menus.js
r44228 r44539 157 157 events: { 158 158 'input #menu-items-search': 'debounceSearch', 159 'keyup #menu-items-search': 'debounceSearch',160 159 'focus .menu-item-tpl': 'focus', 161 160 'click .menu-item-tpl': '_submit', -
trunk/src/js/_enqueues/wp/customize/widgets.js
r43588 r44539 145 145 events: { 146 146 'input #widgets-search': 'search', 147 'keyup #widgets-search': 'search',148 147 'focus .widget-tpl' : 'focus', 149 148 'click .widget-tpl' : '_submit',
Note: See TracChangeset
for help on using the changeset viewer.