summaryrefslogtreecommitdiff
blob: 06b7b015638a3375e6b83dfee68d8f7bd095bb49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* eslint-disable no-var */
/* global wp, calypsoifyGutenberg */

jQuery( function( $ ) {
	if (
		wp &&
		wp.data &&
		wp.data.select &&
		! wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' )
	) {
		wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' );
	}

	var editPostHeaderInception = setInterval( function() {
		var $closeButton = $( '.edit-post-fullscreen-mode-close__toolbar a' );
		if ( $closeButton.length < 1 ) {
			return;
		}
		clearInterval( editPostHeaderInception );

		$closeButton.attr( 'href', calypsoifyGutenberg.closeUrl );
	} );

	$( 'body.revision-php a' ).each( function() {
		var href = $( this ).attr( 'href' );
		$( this ).attr( 'href', href.replace( '&classic-editor', '' ) );
	} );
} );