updated plugin GP Premium
version 1.11.2
This commit is contained in:
@ -7,40 +7,27 @@ jQuery(document).ready(function( $ ) {
|
||||
} );
|
||||
}
|
||||
|
||||
if ( $( '.choose-element-type-parent' ).is( ':visible' ) ) {
|
||||
$( '.select-type' ).focus();
|
||||
}
|
||||
$( '#_generate_block_type' ).on( 'change', function() {
|
||||
var _this = $( this ).val();
|
||||
|
||||
$( 'select[name="_generate_element_type"]' ).on( 'change', function() {
|
||||
var _this = $( this ),
|
||||
element = _this.val();
|
||||
|
||||
if ( '' == element ) {
|
||||
return;
|
||||
if ( 'hook' === _this ) {
|
||||
$( '.hook-row' ).removeClass( 'hide-hook-row' );
|
||||
} else {
|
||||
$( '.hook-row' ).addClass( 'hide-hook-row' );
|
||||
}
|
||||
|
||||
$( '.element-settings' ).addClass( element ).removeClass( 'no-element-type' ).css( 'opacity', '' );
|
||||
$( 'body' ).removeClass( 'no-element-type' );
|
||||
$( 'body' ).removeClass( 'right-sidebar-block-type' );
|
||||
$( 'body' ).removeClass( 'left-sidebar-block-type' );
|
||||
$( 'body' ).removeClass( 'header-block-type' );
|
||||
$( 'body' ).removeClass( 'footer-block-type' );
|
||||
|
||||
var active_tab = $( '.element-metabox-tabs' ).find( 'li:visible:first' );
|
||||
active_tab.addClass( 'is-selected' );
|
||||
$( '.generate-elements-settings[data-tab="' + active_tab.attr( 'data-tab' ) + '"]' ).show();
|
||||
$( 'body' ).addClass( _this + '-block-type' );
|
||||
|
||||
if ( 'layout' === element ) {
|
||||
$( '#generate-element-content' ).hide();
|
||||
if ( 'left-sidebar' === _this || 'right-sidebar' === _this ) {
|
||||
$( '.sidebar-notice' ).show();
|
||||
} else {
|
||||
$( '.sidebar-notice' ).hide();
|
||||
}
|
||||
|
||||
if ( 'header' === element ) {
|
||||
$( 'body' ).addClass( 'header-element-type' );
|
||||
}
|
||||
|
||||
if ( elements.settings && 'layout' !== element ) {
|
||||
$( function() {
|
||||
wp.codeEditor.initialize( "generate-element-content", elements.settings );
|
||||
} );
|
||||
}
|
||||
|
||||
_this.closest( '.choose-element-type-parent' ).hide();
|
||||
} );
|
||||
|
||||
$( '#_generate_hook' ).on( 'change', function() {
|
||||
@ -76,6 +63,10 @@ jQuery(document).ready(function( $ ) {
|
||||
$( '.generate-elements-settings' ).hide();
|
||||
$( '.generate-elements-settings[data-tab="' + tab + '"]' ).show();
|
||||
|
||||
if ( $( '.element-settings' ).hasClass( 'block' ) & 'hook-settings' === tab ) {
|
||||
$( '.generate-elements-settings[data-tab="display-rules"]' ).show();
|
||||
}
|
||||
|
||||
if ( $( '.element-settings' ).hasClass( 'header' ) ) {
|
||||
if ( 'hero' !== tab ) {
|
||||
$( '#generate-element-content' ).next( '.CodeMirror' ).hide();
|
||||
@ -208,6 +199,8 @@ jQuery(document).ready(function( $ ) {
|
||||
|
||||
$( '.condition select.condition-select' ).on( 'change', function() {
|
||||
get_location_objects( $( this ) );
|
||||
|
||||
$( '.elements-no-location-error' ).hide();
|
||||
} );
|
||||
|
||||
$( '.generate-elements-rule-objects-visible' ).each( function() {
|
||||
|
Reference in New Issue
Block a user