Ticket #21283: 21283.11.diff
File 21283.11.diff, 1.1 KB (added by , 12 years ago) |
---|
-
wp-admin/js/color-picker.js
93 93 } 94 94 }); 95 95 96 // allow default color with space or enter 97 self.button.on('keyup', function( e ) { 98 if ( e.keyCode === 13 || e.keyCode === 32 ) { 99 e.preventDefault(); 100 self.button.trigger('click'); 101 } 102 }); 103 96 104 self.button.click( function( event ) { 97 105 var me = $(this); 98 106 if ( me.hasClass( 'wp-picker-clear' ) ) { … … 104 112 self.element.val( self.options.defaultColor ).change(); 105 113 } 106 114 }); 115 116 // allow picking from palette with space or enter 117 var container = $('.iris-palette-container'); 118 container.find('.iris-palette').prop('tabindex', 0).on('keyup', function( e ) { 119 if ( e.keyCode === 13 || e.keyCode === 32 ) { 120 e.preventDefault(); 121 this.click(); 122 this.focus(); // prevent the color text field from taking focus 123 } 124 }); 107 125 }, 108 126 _bodyListener: function( event ) { 109 127 if ( ! event.data.wrap.find( event.target ).length )