}
// The form is being submitted by the user
- $submitButtons = $submitpost.find( ':button, :submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) {
+ $submitButtons = $submitpost.find( ':submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) {
var $button = $(this);
if ( $button.hasClass('disabled') ) {
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',
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);
( 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 {
function endDrag() {
var height, toolbarHeight;
+ if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
+ return;
+ }
+
if ( mce ) {
editor.focus();
- toolbarHeight = $( '#wp-content-editor-container .mce-toolbar-grp' ).height();
+ toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );
if ( toolbarHeight < 10 || toolbarHeight > 200 ) {
toolbarHeight = 30;
}
}
- $textarea.css( 'resize', 'none' );
-
$handle.on( 'mousedown.wp-editor-resize', function( event ) {
if ( typeof tinymce !== 'undefined' ) {
editor = tinymce.get('content');
$( '#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' );
}
});
}