]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/wpview/plugin.js
WordPress 4.7
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wpview / plugin.js
index 2fc0e4b3d858bceae3657e8a926f589ab38e8906..e131474831d2cba5c2a28d1f8c3acd36cc9660cb 100644 (file)
                } );
 
                // Replace any new markers nodes with views.
-               editor.on( 'setcontent', function() {
+               editor.on( 'setcontent', function( event ) {
+                       if ( event.load && ! event.initial && editor.quirks.refreshContentEditable ) {
+                               // Make sure there is a selection in Gecko browsers.
+                               // Or it will refresh the content internally which resets the iframes.
+                               editor.quirks.refreshContentEditable();
+                       }
+
                        wp.mce.views.render();
                } );
 
                // Empty view nodes for easier processing.
-               editor.on( 'preprocess', function( event ) {
+               editor.on( 'preprocess hide', function( event ) {
                        editor.$( 'div[data-wpview-text], p[data-wpview-marker]', event.node ).each( function( i, node ) {
                                node.innerHTML = '.';
                        } );