582 }, |
575 }, |
583 |
576 |
584 // Handles .disabled classes for previous/next buttons in theme installer preview |
577 // Handles .disabled classes for previous/next buttons in theme installer preview |
585 setNavButtonsState: function() { |
578 setNavButtonsState: function() { |
586 var $themeInstaller = $( '.theme-install-overlay' ), |
579 var $themeInstaller = $( '.theme-install-overlay' ), |
587 current = _.isUndefined( this.current ) ? this.model : this.current; |
580 current = _.isUndefined( this.current ) ? this.model : this.current, |
|
581 previousThemeButton = $themeInstaller.find( '.previous-theme' ), |
|
582 nextThemeButton = $themeInstaller.find( '.next-theme' ); |
588 |
583 |
589 // Disable previous at the zero position |
584 // Disable previous at the zero position |
590 if ( 0 === this.model.collection.indexOf( current ) ) { |
585 if ( 0 === this.model.collection.indexOf( current ) ) { |
591 $themeInstaller.find( '.previous-theme' ).addClass( 'disabled' ); |
586 previousThemeButton |
|
587 .addClass( 'disabled' ) |
|
588 .prop( 'disabled', true ); |
|
589 |
|
590 nextThemeButton.focus(); |
592 } |
591 } |
593 |
592 |
594 // Disable next if the next model is undefined |
593 // Disable next if the next model is undefined |
595 if ( _.isUndefined( this.model.collection.at( this.model.collection.indexOf( current ) + 1 ) ) ) { |
594 if ( _.isUndefined( this.model.collection.at( this.model.collection.indexOf( current ) + 1 ) ) ) { |
596 $themeInstaller.find( '.next-theme' ).addClass( 'disabled' ); |
595 nextThemeButton |
|
596 .addClass( 'disabled' ) |
|
597 .prop( 'disabled', true ); |
|
598 |
|
599 previousThemeButton.focus(); |
597 } |
600 } |
598 }, |
601 }, |
599 |
602 |
600 installTheme: function( event ) { |
603 installTheme: function( event ) { |
601 var _this = this; |
604 var _this = this; |
2036 }); |
2039 }); |
2037 |
2040 |
2038 })( jQuery ); |
2041 })( jQuery ); |
2039 |
2042 |
2040 // Align theme browser thickbox |
2043 // Align theme browser thickbox |
2041 var tb_position; |
|
2042 jQuery(document).ready( function($) { |
2044 jQuery(document).ready( function($) { |
2043 tb_position = function() { |
2045 window.tb_position = function() { |
2044 var tbWindow = $('#TB_window'), |
2046 var tbWindow = $('#TB_window'), |
2045 width = $(window).width(), |
2047 width = $(window).width(), |
2046 H = $(window).height(), |
2048 H = $(window).height(), |
2047 W = ( 1040 < width ) ? 1040 : width, |
2049 W = ( 1040 < width ) ? 1040 : width, |
2048 adminbar_height = 0; |
2050 adminbar_height = 0; |