PluginProbe
Extendify / 0.9.3
Extendify v0.9.3
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / editorplus / editorplus.js

editorplus.js in Extendify 0.9.3, at editorplus/editorplus.js

30 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Quick method to hide the title if the template is active
2 if (window._wpLoadBlockEditor) {
3 const finished = window.wp.data.subscribe(() => {
4 const epTemplateSelected =
5 window.wp.data
6 .select('core/editor')
7 .getEditedPostAttribute('template') ===
8 'editorplus-template.php'
9 const title = document.querySelector(
10 '.edit-post-visual-editor__post-title-wrapper',
11 )
12 const wrapper = document.querySelector('.editor-styles-wrapper')
13
14 // Too early
15 if (!title || !wrapper) return
16
17 if (epTemplateSelected) {
18 // GB needs to compute the height first
19 Promise.resolve().then(() => (title.style.display = 'none'))
20 wrapper.style.paddingTop = '0'
21 wrapper.style.backgroundColor = '#ffffff'
22 } else {
23 title.style.removeProperty('display')
24 wrapper.style.removeProperty('padding-top')
25 wrapper.style.removeProperty('background-color')
26 }
27 finished()
28 })
29 }
30