From 056c99305bced7dfde22c028021766526bcd6dc3 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sun, 1 Dec 2013 05:58:42 +0000 Subject: [PATCH] Themes: In the detailed view, disable the next/previous buttons when there are no more items. Fixes #26314 git-svn-id: https://develop.svn.wordpress.org/trunk@26498 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/wp-admin.css | 11 ++++++++--- src/wp-admin/js/theme.js | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) 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