diff --git a/src/wp-admin/css/wp-admin.css b/src/wp-admin/css/wp-admin.css index f274bcbb27..86a7efbdd3 100644 --- a/src/wp-admin/css/wp-admin.css +++ b/src/wp-admin/css/wp-admin.css @@ -6728,11 +6728,16 @@ body.theme-overlay-open { .theme-overlay .right:hover, .theme-overlay .left:hover { background: #333; + color: #fff; } -.theme-overlay .right:hover:before, -.theme-overlay .left:hover:before { - color: #fff; +.theme-overlay .left.disabled, +.theme-overlay .right.disabled, +.theme-overlay .left.disabled:hover, +.theme-overlay .right.disabled:hover { + color: #ccc; + background: inherit; + cursor: inherit; } .theme-overlay .right:before, diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 8039135fd7..b144157117 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -305,6 +305,14 @@ themes.view.Details = wp.Backbone.View.extend({ self.collapse(); } }); + + // Disable Left/Right when at the start or end of the collection + if ( this.model.cid === this.model.collection.at(0).cid ) { + this.$el.find( '.left' ).addClass( 'disabled' ); + } + if ( this.model.cid === this.model.collection.at( this.model.collection.length - 1 ).cid ) { + this.$el.find( '.right' ).addClass( 'disabled' ); + } }, // Performs the actions to effectively close