Make WordPress Core

Changeset 27276


Ignore:
Timestamp:
02/25/2014 09:02:22 PM (12 years ago)
Author:
azaozz
Message:

When closing the various "edit" media modals, remove the related views elements from the DOM. Props gcorne, fixes #27204.

Location:
trunk/src/wp-includes/js
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r27266 r27276  
    27692769
    27702770                        this.controller.on( 'activate', this.refresh, this );
     2771
     2772                        this.controller.on( 'detach', function() {
     2773                                this.$browser.remove();
     2774                        }, this );
    27712775                },
    27722776
  • trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r27159 r27276  
    289289                        updateImage( img, imageData );
    290290                        editor.focus();
     291                        frame.detach();
    291292                };
    292293
     
    295296                frame.on( 'close', function() {
    296297                        editor.focus();
    297         //              editor.selection.select( img );
    298         //              editor.nodeChanged();
     298                        frame.detach();
    299299                });
    300300
  • trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js

    r27239 r27276  
    7474                                var shortcode = gallery.shortcode( selection ).string();
    7575                                editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
     76                                frame.detach();
    7677                        });
    7778                } else if ( editor.dom.hasClass( node, 'wp-playlist' ) && wp.media.playlist ) {
     
    8283                                var shortcode = wp.media.playlist.shortcode( selection ).string();
    8384                                editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
     85                                frame.detach();
    8486                        });
    8587                } else if ( editor.dom.hasClass( node, 'wp-video-playlist' ) && wp.media['video-playlist'] ) {
     
    9092                                var shortcode = wp.media['video-playlist'].shortcode( selection ).string();
    9193                                editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
     94                                frame.detach();
    9295                        });
    9396                } else {
Note: See TracChangeset for help on using the changeset viewer.