Make WordPress Core

Ticket #48562: 48562.2.patch

File 48562.2.patch, 712 bytes (added by Mista-Flo, 4 years ago)

Improve patch, pause the player instead of refreshing everything

  • src/js/media/views/frame/edit-attachments.js

    diff --git a/src/js/media/views/frame/edit-attachments.js b/src/js/media/views/frame/edit-attachments.js
    index 1351a31083..1eef9430ca 100644
    a b EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta 
    9191
    9292                        // Completely destroy the modal DOM element when closing it.
    9393                        this.modal.on( 'close', _.bind( function() {
     94                                // Pause current audio/video even after closing the modal
     95                                $( '.mejs-pause button' ).click();
    9496                                // Remove the keydown event.
    9597                                $( 'body' ).off( 'keydown.media-modal' );
    9698                                // Move focus back to the original item in the grid if possible.