This repository has been archived by the owner on Aug 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.js
42 lines (35 loc) · 1.94 KB
/
admin.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
jQuery(window).ready(function(){
jQuery('.block-editor-page .featured, .block-editor-page .fullscreen, .edit-post-layout__metaboxes .acf-postbox').hide();
var postTemplate = jQuery('.template-selector select').val();
if(postTemplate == 'slideshow') {
var hideThings = setInterval(function(){
jQuery('.block-editor-block-list__layout, .block-editor-writing-flow__click-redirect').hide();
if(jQuery('.block-editor-block-list__layout, .block-editor-writing-flow__click-redirect').width() !== null) {
clearInterval(hideThings);
}
}, 100);
jQuery('.fullscreen, .edit-post-layout__metaboxes .acf-postbox').show();
} else if(postTemplate == 'slider') {
jQuery('.featured, .edit-post-layout__metaboxes .acf-postbox').show();
} else {
var hideThings = setInterval(function(){
jQuery('.edit-post-layout__metaboxes .acf-postbox').hide();
if(jQuery('.edit-post-layout__metaboxes .acf-postbox').width() !== null) {
clearInterval(hideThings);
}
}, 100);
}
jQuery('.template-selector select').change(function(){
postTemplate = jQuery('.template-selector select').val();
if(postTemplate == 'slideshow') {
jQuery('.fullscreen, .edit-post-layout__metaboxes .acf-postbox').show();
jQuery('.featured, .block-editor-block-list__layout, .block-editor-writing-flow__click-redirect').hide();
} else if(postTemplate == 'slider') {
jQuery('.featured, .edit-post-layout__metaboxes .acf-postbox, .block-editor-block-list__layout, .block-editor-writing-flow__click-redirect').show();
jQuery('.fullscreen').hide();
} else {
jQuery('.block-editor-block-list__layout, .block-editor-writing-flow__click-redirect').show();
jQuery('.featured, .fullscreen, .edit-post-layout__metaboxes .acf-postbox').hide();
}
})
})