gutenberg-styles
6 years ago
README.md
6 years ago
class-jetpack-calypsoify.php
3 years ago
mods-gutenberg.js
6 years ago
mods.js
6 years ago
style-gutenberg-rtl.min.css
4 years ago
style-gutenberg.min.css
4 years ago
style-rtl.min.css
4 years ago
style.min.css
4 years ago
mods-gutenberg.js
41 lines
| 1 | /* eslint-disable no-var */ |
| 2 | /* global wp, calypsoifyGutenberg */ |
| 3 | |
| 4 | jQuery( function ( $ ) { |
| 5 | if ( |
| 6 | wp && |
| 7 | wp.data && |
| 8 | wp.data.select && |
| 9 | ! wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ) |
| 10 | ) { |
| 11 | wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); |
| 12 | } |
| 13 | |
| 14 | var editPostHeaderInception = setInterval( function () { |
| 15 | // Legacy selector for Gutenberg plugin < v7.7 |
| 16 | var legacyButton = $( '.edit-post-fullscreen-mode-close__toolbar a' ); |
| 17 | // Updated selector for Gutenberg plugin => v7.7 |
| 18 | var newButton = $( '.edit-post-header .edit-post-fullscreen-mode-close' ); |
| 19 | |
| 20 | var hasLegacyButton = legacyButton && legacyButton.length; |
| 21 | var hasNewButton = newButton && newButton.length; |
| 22 | |
| 23 | // Keep trying until we find one of the close buttons. |
| 24 | if ( ! ( hasLegacyButton || hasNewButton ) ) { |
| 25 | return; |
| 26 | } |
| 27 | clearInterval( editPostHeaderInception ); |
| 28 | |
| 29 | var theButton = legacyButton; |
| 30 | if ( hasNewButton ) { |
| 31 | theButton = newButton; |
| 32 | } |
| 33 | theButton.attr( 'href', calypsoifyGutenberg.closeUrl ); |
| 34 | } ); |
| 35 | |
| 36 | $( 'body.revision-php a' ).each( function () { |
| 37 | var href = $( this ).attr( 'href' ); |
| 38 | $( this ).attr( 'href', href.replace( '&classic-editor', '' ) ); |
| 39 | } ); |
| 40 | } ); |
| 41 |