Changeset 37681
- Timestamp:
- 06/10/2016 10:38:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/plugin-install.js
r37221 r37681 12 12 $tabbables, 13 13 $firstTabbable, 14 $lastTabbable; 14 $lastTabbable, 15 uploadViewToggle = $( '.upload-view-toggle' ), 16 $body = $( document.body ); 15 17 16 18 tb_position = function() { … … 54 56 * modal gets removed from the DOM. 55 57 */ 56 $ ( 'body' )58 $body 57 59 .on( 'thickbox:iframe:loaded', tbWindow, function() { 58 60 iframeLoaded(); … … 181 183 * When a user presses the "Upload Plugin" button, show the upload form in place 182 184 * rather than sending them to the devoted upload plugin page. 183 * @todo consider to abstract this in a generic, reusable, utility, see theme.js 185 * The `?tab=upload` page still exists for no-js support and for plugins that 186 * might access it directly (?). When we're in this page, let the link behave 187 * like a link. Otherwise we're in the normal plugin installer pages and the 188 * link should behave like a toggle button. 184 189 */ 185 var uploadViewToggle = $( '.upload-view-toggle' ), 186 $body = $( document.body ); 187 188 uploadViewToggle 189 .attr({ 190 role: 'button', 191 'aria-expanded': 'false' 192 }) 193 .on( 'click', function( event ) { 194 event.preventDefault(); 195 $body.toggleClass( 'show-upload-view' ); 196 uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) ); 197 }); 190 if ( ! uploadViewToggle.hasClass( 'upload-tab' ) ) { 191 uploadViewToggle 192 .attr({ 193 role: 'button', 194 'aria-expanded': 'false' 195 }) 196 .on( 'click', function( event ) { 197 event.preventDefault(); 198 $body.toggleClass( 'show-upload-view' ); 199 uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) ); 200 }); 201 } 198 202 });
Note: See TracChangeset
for help on using the changeset viewer.