]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/post.js
WordPress 4.0
[autoinstalls/wordpress.git] / wp-admin / js / post.js
index 21f28e7d5e268bc3f91b4e1fec8b7b6681e761c4..45413f8e99bb2ff84f86e2d8c202333e70b20fe3 100644 (file)
@@ -892,7 +892,8 @@ jQuery(document).ready( function($) {
                b.children('.save').click(function() {
                        var new_slug = e.children('input').val();
                        if ( new_slug == $('#editable-post-name-full').text() ) {
-                               return $('#edit-slug-buttons .cancel').click();
+                               b.children('.cancel').click();
+                               return false;
                        }
                        $.post(ajaxurl, {
                                action: 'sample-permalink',
@@ -915,7 +916,7 @@ jQuery(document).ready( function($) {
                        return false;
                });
 
-               $('#edit-slug-buttons .cancel').click(function() {
+               b.children('.cancel').click(function() {
                        $('#view-post-btn').show();
                        e.html(revert_e);
                        b.html(revert_b);
@@ -1003,14 +1004,21 @@ jQuery(document).ready( function($) {
        ( function() {
                var editor, offset, mce,
                        $textarea = $('textarea#content'),
-                       $handle = $('#post-status-info');
+                       $handle = $('#post-status-info'),
+                       $postdivrich = $('#postdivrich');
 
                // No point for touch devices
                if ( ! $textarea.length || 'ontouchstart' in window ) {
+                       // Hide the resize handle
+                       $('#content-resize-handle').hide();
                        return;
                }
 
                function dragging( event ) {
+                       if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
+                               return;
+                       }
+
                        if ( mce ) {
                                editor.theme.resizeTo( null, offset + event.pageY );
                        } else {
@@ -1023,6 +1031,10 @@ jQuery(document).ready( function($) {
                function endDrag() {
                        var height, toolbarHeight;
 
+                       if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
+                               return;
+                       }
+
                        if ( mce ) {
                                editor.focus();
                                toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );
@@ -1045,8 +1057,6 @@ jQuery(document).ready( function($) {
                        }
                }
 
-               $textarea.css( 'resize', 'none' );
-
                $handle.on( 'mousedown.wp-editor-resize', function( event ) {
                        if ( typeof tinymce !== 'undefined' ) {
                                editor = tinymce.get('content');
@@ -1073,14 +1083,11 @@ jQuery(document).ready( function($) {
                $( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() {
                        var editor, body, format = this.id;
 
-                       if ( format && $( this ).prop('checked') ) {
-                               editor = tinymce.get( 'content' );
-
-                               if ( editor ) {
-                                       body = editor.getBody();
-                                       body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
-                                       editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
-                               }
+                       if ( format && $( this ).prop( 'checked' ) && ( editor = tinymce.get( 'content' ) ) ) {
+                               body = editor.getBody();
+                               body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
+                               editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
+                               $( document ).trigger( 'editor-classchange' );
                        }
                });
        }