Make WordPress Core

Ticket #40589: 40589.diff

File 40589.diff, 1.4 KB (added by psiico, 8 years ago)

patch

  • src/wp-includes/js/media-views.js

     
    28242824                        this.$bar.width( this.model.get('percent') + '%' );
    28252825                }
    28262826        },
    2827 
    28282827        /**
    28292828         * @param {Object} event
    28302829         */
     
    29452944                        selection[ method ]( model );
    29462945                        selection.single( model );
    29472946                }
     2947
     2948                // Disable Replace button if no file is selected
     2949                if (selection.length == 0) {
     2950                        $('.media-button-replace').attr('disabled', 'disabled');
     2951                } else {
     2952                        $('.media-button-replace').removeAttr('disabled');
     2953                }
     2954
    29482955        },
    29492956
    29502957        updateSelect: function() {
     
    31673174         */
    31683175        checkClickHandler: function ( event ) {
    31693176                var selection = this.options.selection;
     3177
    31703178                if ( ! selection ) {
    31713179                        return;
    31723180                }
     
    31783186                } else {
    31793187                        selection.add( this.model );
    31803188                }
     3189                // Disable Replace button if no file is selected
     3190                if (selection.length == 0) {
     3191                        $('.media-button-replace').attr('disabled', 'disabled');
     3192                } else {
     3193                        $('.media-button-replace').removeAttr('disabled');
     3194                }
    31813195        }
    31823196});
    31833197
     
    33443358                }
    33453359
    33463360                if ( 37 === event.keyCode || 38 === event.keyCode || 39 === event.keyCode || 40 === event.keyCode ) {
    3347                         this.controller.trigger( 'attachment:keydown:arrow', event );
    3348                         return;
     3361                        //this.controller.trigger( 'attachment:keydown:arrow', event );
     3362                        //return;
    33493363                }
    33503364        }
    33513365});