' );
const column = $( '.botiga-bhfb-' + current_row + '-row' ).find( '.botiga-bhfb-area:last-child' );
if( columns.length ) {
for( let element of columns ) {
element = _this.getElementData( element );
column.append(
'
'
);
}
}
column_id++;
}
}
// Mobile.
if( _this.currentDevice === 'mobile' ) {
let column_id = 1;
for( const columns of value.mobile ) {
$( '.botiga-bhfb-' + current_row + '-row' ).append( '
' );
const column = $( '.botiga-bhfb-' + current_row + '-row' ).find( '.botiga-bhfb-area:last-child' );
if( columns.length ) {
for( let element of columns ) {
element = _this.getElementData( element );
column.append(
'
'
);
}
}
column_id++;
}
// Mobile Off-Canvas.
if( field.indexOf( 'mobile_offcanvas' ) !== -1 ) {
$( '.botiga-bhfb-area-offcanvas' ).html( '' );
if( value.mobile_offcanvas.length ) {
const elements = value.mobile_offcanvas[0];
for( var element of elements ) {
element = _this.getElementData( element );
$( '.botiga-bhfb-area-offcanvas' ).append(
'
'
);
}
}
}
}
}
if( ! _this.currentBuilder ) {
_this.builderGridContentFlag = false;
return false;
}
if( _this.currentBuilder.hasClass( 'show' ) && ! _this.currentBuilder.hasClass( 'show-bottom' ) ) {
$( '.botiga-bhfb' ).css( 'height', 0 );
_this.currentBuilder.css( 'height', _this.currentBuilder.find( '.botiga-bhfb-top' ).outerHeight() + 47 );
} else {
_this.currentBuilder.css( 'height', 0 );
}
_this.updateAvailableComponents();
_this.elementsSortable();
$( window ).trigger( 'bhfb.grid.ready' );
_this.builderGridContentFlag = false;
}, _this.updateGridDelay);
},
getElementData: function( element ){
const _this = this;
let elements = [
...botiga_hfb.components.desktop,
...botiga_hfb.components.mobile
];
if( _this.currentBuilderType === 'footer' ) {
elements = botiga_hfb.components.footer;
}
for( var el of elements ) {
if( el.id === element ) {
return el;
}
}
return '';
},
showHideBuilder: function() {
const self = this;
const sections = [
// Header
'botiga_section_hb_wrapper',
'botiga_section_hb_presets',
'botiga_section_hb_above_header_row',
'botiga_section_hb_main_header_row',
'botiga_section_hb_below_header_row',
'botiga_section_hb_mobile_offcanvas',
'botiga_section_hb_component__logo',
'botiga_section_hb_component__search',
'botiga_section_hb_component__social',
'botiga_section_hb_component__menu',
'botiga_section_hb_component__secondary_menu',
'botiga_section_hb_component__contact_info',
'botiga_section_hb_component__button',
'botiga_section_hb_component__button2',
'botiga_section_hb_component__html',
'botiga_section_hb_component__html2',
'botiga_section_hb_component__shortcode',
'botiga_section_hb_component__login_register',
'botiga_section_hb_component__woo_icons',
'botiga_section_hb_component__pll_switcher',
'botiga_section_hb_component__wpml_switcher',
'botiga_section_hb_component__mobile_offcanvas_menu',
'botiga_section_hb_component__mobile_hamburger',
// Footer
'botiga_section_fb_wrapper',
'botiga_section_fb_above_footer_row',
'botiga_section_fb_main_footer_row',
'botiga_section_fb_below_footer_row',
'botiga_section_fb_component__social',
'botiga_section_fb_component__footer_menu',
'botiga_section_fb_component__copyright',
'botiga_section_fb_component__button',
'botiga_section_fb_component__button2',
'botiga_section_fb_component__html',
'botiga_section_fb_component__html2',
'botiga_section_fb_component__shortcode',
'botiga_section_fb_component__widget1',
'botiga_section_fb_component__widget2',
'botiga_section_fb_component__widget3',
'botiga_section_fb_component__widget4'
];
// Append columns to the sections array.
const rows = [ 'above', 'main', 'below' ];
for( const row of rows ) {
for( let i=1; i<=6; i++ ) {
sections.push( 'botiga_header_row__'+ row +'_header_row_column' + i );
sections.push( 'botiga_footer_row__'+ row +'_footer_row_column' + i );
}
}
sections.forEach( function( section ){
if( typeof wp.customize.section( section ) !== 'undefined' ) {
wp.customize.section( section ).expanded.bind(
function( is_active ){
self.currentBuilder = self.getCurrentBuilderByComponent( section );
self.currentBuilderType = self.currentBuilder.hasClass( 'botiga-bhfb-header' ) ? 'header' : 'footer';
if( is_active ) {
$( 'body' ).addClass( 'bhfb-active' );
self.currentBuilder.addClass( 'show' );
self.scrollToRespectiveBuilderArea();
} else {
$( 'body' ).removeClass( 'bhfb-active' );
self.currentBuilder.removeClass( 'show' );
}
setTimeout(function(){
self.builderGridContent();
// Update available components.
if( section === 'botiga_section_hb_wrapper' || section === 'botiga_section_fb_wrapper' ) {
$( '.botiga-bhfb-' + self.currentBuilderType ).find( '.botiga-bhfb-above-row .botiga-bhfb-area' ).trigger( 'click' );
$( '.botiga-bhfb-elements' ).removeClass( 'show' );
}
}, 100);
}
);
}
} );
},
scrollToRespectiveBuilderArea: function() {
const
_this = this,
iframeHTMLTag = document.querySelector( '#customize-preview > iframe' ).contentWindow.document.getElementsByTagName('html')[0],
scrollTo = _this.currentBuilderType === 'header' ? 0 : 99999;
$( iframeHTMLTag ).animate( { scrollTop: scrollTo }, 'fast' );
},
getCurrentBuilderByComponent: function( component ) {
if( component.indexOf( '_hb_' ) !== -1 || component.indexOf( '_header_' ) !== -1 ) {
return $( '.botiga-bhfb-header' );
} else if( component.indexOf( '_fb_' ) !== -1 || component.indexOf( '_footer_' ) !== -1 ) {
return $( '.botiga-bhfb-footer' );
}
return false;
},
showHideBuilderTop: function() {
const self = this;
$( '.botiga-bhfb-bottom-display' ).on( 'click', function(e){
e.preventDefault();
$( 'body' ).toggleClass( 'bhfb-active-bottom' );
$( this ).toggleClass( 'show' );
$( '.botiga-bhfb-top' ).toggleClass( 'show' );
$( '.botiga-bhfb' ).toggleClass( 'show-bottom' );
self.builderGridContent();
} );
},
builderCustomColumns: function() {
const
_this = this,
options = [
'botiga_header_row__above_header_row_columns',
'botiga_header_row__main_header_row_columns',
'botiga_header_row__below_header_row_columns',
'botiga_footer_row__above_footer_row_columns_desktop',
'botiga_footer_row__main_footer_row_columns_desktop',
'botiga_footer_row__below_footer_row_columns_desktop'
];
options.forEach( function( optionID ){
if( typeof wp.customize.control( optionID ) !== 'undefined' ) {
const devices = optionID.indexOf( 'header' ) !== -1 ? [ 'desktop', 'tablet' ] : [ 'desktop' ];
for( const device of devices ) {
const deviceSelector = optionID.indexOf( 'header' ) !== -1 ? '_' + device : '';
wp.customize( optionID + deviceSelector, function( option ) {
option.bind( function( to ) {
let
rows = [ 'above', 'main', 'below' ],
rowSelector = '',
$rowInput = '';
for( const row of rows ) {
const
rowOptionID = 'botiga_'+ _this.currentBuilderType +'_row__'+ row +'_'+ _this.currentBuilderType,
rowInputSelector = '#_customize-input-botiga_'+ _this.currentBuilderType +'_row__'+ row +'_'+ _this.currentBuilderType +'_row';
if( optionID.indexOf( rowOptionID ) !== -1 ) {
rowSelector = 'botiga-bhfb-'+ row +'-row';
$rowInput = $( rowInputSelector );
_this.currentRow = row;
}
}
if( rowSelector === '' || $rowInput === '' ) {
return false;
}
// Update builder row columns class.
_this.addBuilderRowColumnsClass( device, rowSelector, to );
// Update row input value.
let
current_value = _this.jsonDecode( $rowInput.val() );
// Add column.
if( to < current_value[_this.currentDevice].length ) {
while( current_value[_this.currentDevice].length > to ) {
current_value[_this.currentDevice].pop();
}
// Remove column.
} else if( to > current_value[_this.currentDevice].length ) {
while( current_value[_this.currentDevice].length < to ) {
current_value[_this.currentDevice].push([]);
}
}
// Update the value in the customizer field.
$rowInput.val( JSON.stringify( current_value ) );
// Update the respective row columns layout customizer field.
_this.updateColumnsLayoutOption( device, to );
// Update 'Available Columns' area.
_this.updateAvailableColumnsArea( device, to );
// Trigger change in the customizer field (desktop).
$rowInput.trigger( 'change' );
// Trigger change in the customizer field (mobile).
if( _this.currentBuilderType === 'header' && _this.currentDevice === 'mobile' ) {
$rowInput.closest( '.customize-control' ).next().find( 'input' ).val( Math.random() ).trigger( 'change' );
}
// Update grid.
_this.builderGridContent();
} );
} );
}
}
} );
// Main purpose of the below code is update 'Columns Layout' options on the first load.
const
areas = [ 'header', 'footer' ],
rows = [ 'above', 'main', 'below' ];
for( const area of areas ) {
const prefix = area === 'header' ? 'hb' : 'fb';
for( const row of rows ) {
const sectionID = 'botiga_section_'+ prefix +'_'+ row +'_'+ area +'_row';
if( typeof wp.customize.section( sectionID ) !== 'undefined' ) {
wp.customize.section( sectionID ).expanded.bind(
function( is_active ){
if( is_active ) {
if( sectionID.indexOf( 'header' ) !== -1 ) {
_this.currentBuilderType = 'header';
} else if( sectionID.indexOf( 'footer' ) !== -1 ) {
_this.currentBuilderType = 'footer';
}
const devices = _this.currentBuilderType === 'header' ? [ 'desktop', 'tablet' ] : [ 'desktop' ];
for( const device of devices ) {
setTimeout(function(){
const
rowSelector = 'botiga-bhfb-'+ row +'-row',
columnsOptionID = 'botiga_'+ _this.currentBuilderType +'_row__'+ row +'_'+ _this.currentBuilderType +'_row_columns_'+ device;
_this.currentRow = row;
_this.currentRowInput = $( '#_customize-input-botiga_' + _this.currentBuilderType + '_row__' + row + '_' + _this.currentBuilderType + '_row' );
// Update builder row columns class.
_this.addBuilderRowColumnsClass( device, rowSelector, wp.customize( columnsOptionID ).get() );
// Update 'Columns Layout' options.
_this.updateColumnsLayoutOption( device, wp.customize( columnsOptionID ).get() );
// Update 'Available Columns' area.
_this.updateAvailableColumnsArea( device, wp.customize( columnsOptionID ).get() );
}, 50);
}
}
}
);
}
}
}
},
addBuilderRowColumnsClass: function( device, rowSelector, to ) {
const _this = this;
if( device === 'tablet' ) {
device = 'mobile';
}
// Remove all possible columns class.
for( let i=1; i<=6; i++ ) {
$( '.botiga-bhfb-'+ _this.currentBuilderType +' .botiga-bhfb-'+ device +' .botiga-bhfb-row.' + rowSelector ).removeClass( 'botiga-bhfb-row-' + i + '-columns' );
}
// Add new columns class.
$( '.botiga-bhfb-'+ _this.currentBuilderType +' .botiga-bhfb-'+ device +' .botiga-bhfb-row.' + rowSelector ).addClass( 'botiga-bhfb-row-' + to + '-columns' );
},
updateColumnsLayoutOption: function( device, val ) {
const
_this = this,
setting_id = 'botiga_'+ _this.currentBuilderType +'_row__'+ _this.currentRow +'_'+ _this.currentBuilderType +'_row_columns_layout_' + device,
selector = setting_id +'-'+ wp.customize( setting_id ).get();
// Hide the column layout options that doesn't match with 'columns' value.
$( 'label[for*="'+ setting_id +'"]' ).css( 'display', 'none' );
$( 'label[for*="'+ setting_id +'-'+ val +'col-"]' ).css( 'display', 'block' );
if( $( 'label[for="'+ selector +'"]' ).parent().hasClass( 'bhfb-option-updated' ) ) {
return false;
}
// Remove active class from current option.
// $( 'label[for="'+ selector +'"]' ).removeClass( 'ui-state-active' );
// Set new value and change active class.
// wp.customize( setting_id ).set( val + 'col-equal' );
// $( 'label[for="'+ setting_id +'-'+ val +'col-equal"]' ).trigger( 'click' ).addClass( 'ui-state-active' );
// Add class as a flag.
$( 'label[for="'+ selector +'"]' ).parent().addClass( 'bhfb-option-updated' );
},
builderColumnsLayout: function() {
const
_this = this,
options = [
'botiga_header_row__above_header_row_columns_layout',
'botiga_header_row__main_header_row_columns_layout',
'botiga_header_row__below_header_row_columns_layout',
'botiga_footer_row__above_footer_row_columns_layout_desktop',
'botiga_footer_row__main_footer_row_columns_layout_desktop',
'botiga_footer_row__below_footer_row_columns_layout_desktop'
];
options.forEach( function( optionID ){
if( typeof wp.customize.control( optionID ) !== 'undefined' ) {
const devices = optionID.indexOf( 'header' ) !== -1 ? [ 'desktop', 'tablet' ] : [ 'desktop' ];
for( let device of devices ) {
const deviceSelector = optionID.indexOf( 'header' ) !== -1 ? '_' + device : '';
wp.customize( optionID + deviceSelector, function( option ) {
option.bind( function( to ) {
let current_row = 'above';
if( optionID.indexOf( 'main' ) !== -1 ) {
current_row = 'main';
} else if( optionID.indexOf( 'below' ) !== -1 ) {
current_row = 'below';
}
// Convert 'tablet' to 'mobile' because html selectors are 'mobile' and not 'tablet'.
if( device === 'tablet' ) {
device = 'mobile';
}
_this.currentRowInput = $( '#_customize-input-botiga_'+ _this.currentBuilderType +'_row__'+ current_row +'_'+ _this.currentBuilderType +'_row' );
const $builderRow = $( '.botiga-bhfb-'+ _this.currentBuilderType +' .botiga-bhfb-'+ device +' .botiga-bhfb-row.botiga-bhfb-' + current_row + '-row' );
$builderRow.removeClass( 'botiga-bhfb-row-columns-layout-equal' );
$builderRow.removeClass( 'botiga-bhfb-row-columns-layout-bigleft' );
$builderRow.removeClass( 'botiga-bhfb-row-columns-layout-bigright' );
if( to.indexOf( 'equal' ) !== -1 ) {
$builderRow.addClass( 'botiga-bhfb-row-columns-layout-equal');
}
if( to.indexOf( 'bigleft' ) !== -1 ) {
$builderRow.addClass( 'botiga-bhfb-row-columns-layout-bigleft');
}
if( to.indexOf( 'bigright' ) !== -1 ) {
$builderRow.addClass( 'botiga-bhfb-row-columns-layout-bigright');
}
// Trigger change in the customizer field to run the selective refresh on the respective row.
const inputValue = _this.currentRowInput.val();
_this.currentRowInput.val( '' ).trigger( 'change' );
_this.currentRowInput.val( inputValue ).trigger( 'change' );
// Trigger change on mobile row field.
if( _this.currentBuilderType === 'header' && _this.currentDevice === 'mobile' ) {
_this.currentRowInput.closest( '.customize-control' ).next().find( 'input' ).val( Math.random() ).trigger( 'change' );
}
});
});
}
}
});
},
updateAvailableColumnsArea: function( device, colsNumber ) {
const
_this = this,
rowSection = _this.currentRowInput.closest( '.control-section' ),
avCompsItems = rowSection.find( '.bhfb-available-columns.bhfb-available-columns-'+ device +' .bhfb-available-columns-item' );
avCompsItems.addClass( 'hide' );
for( let i=1; i<=colsNumber; i++ ) {
avCompsItems.eq( i - 1 ).removeClass( 'hide' );
}
},
footerCustomizerOptions: function() {
// Rows.
const rows = [ 'above', 'main', 'below' ];
for( const row of rows ) {
const fieldID = 'botiga_footer_row__' + row + '_footer_row';
// Vertical Aligment.
wp.customize( fieldID, function( option ) {
option.bind( function( to ) {
$( '.bhfb-footer' ).remove();
} );
} );
}
},
extraNavigation: function() {
const _this = this;
wp.customize.panel( 'botiga_panel_footer' ).expanded.bind(function( is_active ){
if( is_active ) {
wp.customize.section( 'botiga_section_fb_wrapper' ).focus();
}
});
},
headerPresets: function() {
const _this = this;
wp.customize( 'botiga_section_hb_presets__header_preset_layout', function( option ) {
option.bind( function( to ) {
_this.updateHeaderPreset( to );
} );
} );
},
updateHeaderPreset: function( preset ) {
const
_this = this,
$above_row = $( '#_customize-input-botiga_header_row__above_header_row' ),
$main_row = $( '#_customize-input-botiga_header_row__main_header_row' ),
$below_row = $( '#_customize-input-botiga_header_row__below_header_row' );
// Set some others customizer settings.
if( preset === 'header_layout_1' ) {
wp.customize( 'botiga_header_row__main_header_row_column1_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column1_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column1_horizontal_alignment_desktop' ).set( 'start' );
wp.customize( 'botiga_header_row__main_header_row_column2_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column2_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column2_horizontal_alignment_desktop' ).set( 'center' );
wp.customize( 'botiga_header_row__main_header_row_column3_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column3_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column3_horizontal_alignment_desktop' ).set( 'end' );
}
if( preset === 'header_layout_2' ) {
wp.customize( 'botiga_header_row__main_header_row_column1_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column1_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column1_horizontal_alignment_desktop' ).set( 'start' );
wp.customize( 'botiga_header_row__main_header_row_column2_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column2_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column2_horizontal_alignment_desktop' ).set( 'end' );
}
if( preset === 'header_layout_3' ) {
wp.customize( 'botiga_header_row__main_header_row_column1_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column1_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column1_horizontal_alignment_desktop' ).set( 'start' );
wp.customize( 'botiga_header_row__main_header_row_column2_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column2_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column2_horizontal_alignment_desktop' ).set( 'center' );
wp.customize( 'botiga_header_row__main_header_row_column3_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column3_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column3_horizontal_alignment_desktop' ).set( 'end' );
wp.customize( 'botiga_header_row__below_header_row_column1_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__below_header_row_column1_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__below_header_row_column1_horizontal_alignment_desktop' ).set( 'center' );
}
if( preset === 'header_layout_4' ) {
wp.customize( 'botiga_header_row__main_header_row_column1_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column1_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column1_horizontal_alignment_desktop' ).set( 'start' );
wp.customize( 'botiga_header_row__main_header_row_column2_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column2_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column2_horizontal_alignment_desktop' ).set( 'end' );
wp.customize( 'botiga_header_row__below_header_row_column1_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__below_header_row_column1_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__below_header_row_column1_horizontal_alignment_desktop' ).set( 'start' );
wp.customize( 'botiga_header_row__below_header_row_column2_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__below_header_row_column2_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__below_header_row_column2_horizontal_alignment_desktop' ).set( 'end' );
}
if( preset === 'header_layout_5' ) {
wp.customize( 'botiga_header_row__main_header_row_column1_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column1_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column1_horizontal_alignment_desktop' ).set( 'start' );
wp.customize( 'botiga_header_row__main_header_row_column2_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column2_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column2_horizontal_alignment_desktop' ).set( 'center' );
wp.customize( 'botiga_header_row__main_header_row_column3_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column3_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column3_horizontal_alignment_desktop' ).set( 'end' );
wp.customize( 'botiga_header_row__below_header_row_column1_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__below_header_row_column1_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__below_header_row_column1_horizontal_alignment_desktop' ).set( 'start' );
wp.customize( 'botiga_header_row__below_header_row_column2_vertical_alignment_desktop' ).set( 'middle' );
wp.customize( 'botiga_header_row__below_header_row_column2_inner_layout_desktop' ).set( 'inline' );
wp.customize( 'botiga_header_row__below_header_row_column2_horizontal_alignment_desktop' ).set( 'end' );
}
// Mobile (always same layout for all presets).
wp.customize( 'botiga_header_row__main_header_row_column1_vertical_alignment_tablet' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column1_inner_layout_tablet' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column1_horizontal_alignment_tablet' ).set( 'start' );
wp.customize( 'botiga_header_row__main_header_row_column1_vertical_alignment_mobile' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column1_inner_layout_mobile' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column1_horizontal_alignment_mobile' ).set( 'start' );
wp.customize( 'botiga_header_row__main_header_row_column2_vertical_alignment_tablet' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column2_inner_layout_tablet' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column2_horizontal_alignment_tablet' ).set( 'center' );
wp.customize( 'botiga_header_row__main_header_row_column2_vertical_alignment_mobile' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column2_inner_layout_mobile' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column2_horizontal_alignment_mobile' ).set( 'center' );
wp.customize( 'botiga_header_row__main_header_row_column3_vertical_alignment_tablet' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column3_inner_layout_tablet' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column3_horizontal_alignment_tablet' ).set( 'end' );
wp.customize( 'botiga_header_row__main_header_row_column3_vertical_alignment_mobile' ).set( 'middle' );
wp.customize( 'botiga_header_row__main_header_row_column3_inner_layout_mobile' ).set( 'inline' );
wp.customize( 'botiga_header_row__main_header_row_column3_horizontal_alignment_mobile' ).set( 'end' );
// Set row settings and trigger change.
$above_row.val( botiga_hfb.header_presets[ preset ][ 'above_row' ] ).trigger( 'change' );
$main_row.val( botiga_hfb.header_presets[ preset ][ 'main_row' ] ).trigger( 'change' );
$below_row.val( botiga_hfb.header_presets[ preset ][ 'below_row' ] ).trigger( 'change' );
// Trigger change on mobile row field.
$above_row.closest( '.customize-control' ).next().find( 'input' ).val( Math.random() ).trigger( 'change' );
$main_row.closest( '.customize-control' ).next().find( 'input' ).val( Math.random() ).trigger( 'change' );
$below_row.closest( '.customize-control' ).next().find( 'input' ).val( Math.random() ).trigger( 'change' );
_this.builderGridContent();
}
}
$( document ).ready(function(){
bhfb.init();
});
})(jQuery);