Changeset 64241 for trunk/src/js/_enqueues/wp/theme.js
- Timestamp:
- 10/08/2026 11:33:48 AM (9 days ago)
- File:
-
- 1 edited
-
trunk/src/js/_enqueues/wp/theme.js (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/theme.js
r63766 r64241 481 481 } 482 482 483 // S et focused theme to current element.483 // Store the theme that had focus when expand is called. 484 484 themes.focusedTheme = this.$el; 485 485 … … 521 521 event = event || window.event; 522 522 523 // S et focus to current theme.523 // Store the theme that had focus when preview is called. 524 524 themes.focusedTheme = this.$el; 525 525 … … 621 621 previousThemeButton 622 622 .addClass( 'disabled' ) 623 .prop( 'disabled', true ); 624 625 nextThemeButton.trigger( 'focus' ); 623 .attr( 'aria-disabled', true ) 624 .trigger( 'focus' ); 626 625 } 627 626 … … 630 629 nextThemeButton 631 630 .addClass( 'disabled' ) 632 .prop( 'disabled', true ); 633 634 previousThemeButton.trigger( 'focus' ); 631 .attr( 'aria-disabled', true ) 632 .trigger( 'focus' ); 635 633 } 636 634 }, … … 726 724 // Set initial focus and constrain tabbing within the theme browser modal. 727 725 containFocus: function( $el ) { 728 729 // Set initial focus on the primary action control. 730 _.delay( function() { 731 $( '.theme-overlay' ).trigger( 'focus' ); 732 }, 100 ); 726 // Set initial focus on the theme overlay modal dialog, only on first render. 727 var $themeOverlay = $( '.theme-overlay' ); 728 if ( $themeOverlay.hasClass( 'theme-overlay-initial' ) ) { 729 _.delay( function() { 730 $themeOverlay.trigger( 'focus' ).removeClass( 'theme-overlay-initial' ); 731 }, 100 ); 732 } 733 733 734 734 735 // Constrain tabbing within the modal. … … 786 787 document.body.scrollTop = scroll; 787 788 788 // Return focus to the theme div.789 // Return focus to the opener theme 'more-details' button. 789 790 if ( themes.focusedTheme ) { 790 themes.focusedTheme.find( '.more-details').trigger( 'focus' );791 themes.focusedTheme.find( '.more-details' ).trigger( 'focus' ); 791 792 } 793 794 // Add back the `theme-overlay-initial` class for the theme overlay. 795 $( '.theme-overlay' ).addClass( 'theme-overlay-initial' ); 792 796 }); 793 797 } … … 804 808 this.$el.find( '.left' ) 805 809 .addClass( 'disabled' ) 806 . prop( 'disabled', true );810 .attr( 'aria-disabled', true ); 807 811 } 808 812 if ( this.model.cid === this.model.collection.at( this.model.collection.length - 1 ).cid ) { 809 813 this.$el.find( '.right' ) 810 814 .addClass( 'disabled' ) 811 . prop( 'disabled', true );815 .attr( 'aria-disabled', true ); 812 816 } 813 817 }, … … 961 965 this.$el.fadeIn( 200, function() { 962 966 $body.addClass( 'theme-installer-active full-overlay-active' ); 967 // Set initial focus on the theme installer overlay modal dialog. 968 self.$el.trigger( 'focus' ); 963 969 }); 964 970 … … 977 983 $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' ); 978 984 979 // Return focus to the theme div.985 // Return focus to the opener theme 'more-details' button. 980 986 if ( themes.focusedTheme ) { 981 themes.focusedTheme.find( '.more-details').trigger( 'focus' );987 themes.focusedTheme.find( '.more-details' ).trigger( 'focus' ); 982 988 } 983 989 }).removeClass( 'iframe-ready' ); … … 1355 1361 // Trigger a route update for the current model. 1356 1362 self.theme.trigger( 'theme:expand', nextModel.cid ); 1363 // Set focus again to the 'Next' navigation button after the view fully re-rendeers. 1364 $( '.theme-header .right' ).trigger( 'focus' ); 1357 1365 themes.announceThemeDebounced( nextModel ); 1358 1366 } … … 1390 1398 // Trigger a route update for the current model. 1391 1399 self.theme.trigger( 'theme:expand', previousModel.cid ); 1400 // Set focus again to the 'Previous' navigation button after the view fully re-rendeers. 1401 $( '.theme-header .left' ).trigger( 'focus' ); 1392 1402 themes.announceThemeDebounced( previousModel ); 1393 1403 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)