X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0461a5f2e55c8d5f1fde96ca2e83117152573c7d..refs/tags/wordpress-4.0:/wp-admin/js/post.js diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 21f28e7d..45413f8e 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -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' ); } }); }