]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/wpview/plugin.js
Wordpress 4.5.3-scripts
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wpview / plugin.js
index 104006a175e9d7c436e0219323693ed96dac4491..61f34bc4b444d5a9dcd15d2f76ace3f90e44b07c 100644 (file)
@@ -347,6 +347,15 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
                                attributeFilter: ['class']
                        } );
                }
+
+               if ( tinymce.Env.ie ) {
+                       // Prevent resize handles in newer IE
+                       editor.dom.bind( editor.getBody(), 'controlselect mscontrolselect', function( event ) {
+                               if ( getView( event.target ) ) {
+                                       event.preventDefault();
+                               }
+                       });
+               }
        });
 
        // Empty the wpview wrap and marker nodes
@@ -713,10 +722,12 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
        } );
 
        editor.once( 'preinit', function() {
-               toolbar = editor.wp._createToolbar( [
-                       'wp_view_edit',
-                       'wp_view_remove'
-               ] );
+               if ( editor.wp && editor.wp._createToolbar ) {
+                       toolbar = editor.wp._createToolbar( [
+                               'wp_view_edit',
+                               'wp_view_remove'
+                       ] );
+               }
        } );
 
        editor.on( 'wptoolbar', function( event ) {
@@ -729,6 +740,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
        // Add to editor.wp
        editor.wp = editor.wp || {};
        editor.wp.getView = getView;
+       editor.wp.setViewCursor = setViewCursor;
 
        // Keep for back-compat.
        return {