Make WordPress Core

Ticket #26459: 26459.2.diff

File 26459.2.diff, 1.8 KB (added by matveb, 11 years ago)
  • wp-admin/js/theme.js

     
    250250                this.activeTheme();
    251251                // Set up navigation events
    252252                this.navigation();
     253                // Checks screenshot size
     254                this.screenshotCheck( this.$el );
    253255        },
    254256
    255257        // Adds a class to the currently active theme
     
    352354        previousTheme: function() {
    353355                var self = this;
    354356                self.trigger( 'theme:previous', self.model.cid );
     357        },
     358
     359        // Checks if the theme screenshot is the old 300px width version
     360        // and adds a corresponding class if it's true
     361        screenshotCheck: function( el ) {
     362                var screenshot, image, width;
     363
     364                screenshot = el.find( '.screenshot img' );
     365                image = new Image();
     366                image.src = screenshot.attr( 'src' );
     367
     368                // Width check
     369                if ( image.width <= 300 ) {
     370                        el.addClass( 'small-screenshot' );
     371                }
    355372        }
    356373});
    357374
  • wp-admin/css/wp-admin.css

     
    68946894        top: 0;
    68956895        width: 100%;
    68966896}
     6897/* Handles old 300px screenshots */
     6898.theme-overlay.small-screenshot .theme-screenshots {
     6899        position: absolute;
     6900        width: 302px;
     6901}
     6902.theme-overlay.small-screenshot .theme-info {
     6903        margin-left: 350px;
     6904        width: auto;
     6905}
    68976906
    68986907/* Other screenshots, shown small and square */
    68996908.theme-overlay .screenshot.thumb {
     
    71627171        .theme-browser .theme .theme-actions {
    71637172                padding: 5px 10px 4px 10px;
    71647173        }
     7174        .theme-overlay.small-screenshot .theme-screenshots {
     7175                position: static;
     7176                float: none;
     7177                max-width: 302px;
     7178        }
     7179        .theme-overlay.small-screenshot .theme-info {
     7180                margin-left: 0;
     7181                width: auto;
     7182        }
    71657183}
    71667184
    71677185@media only screen and (max-width: 480px) {