"use strict"; /* Basic -------------------------------------------------------------- */ (function($) { var abrMetabox = {}; ( function() { var $this; abrMetabox = { /* * Initialize */ init: function( e ) { $this = abrMetabox; // Variables. $this.wrap = $( '.abr-metabox-wrap' ); // Init. $this.metaboxInit( e ); // Init events. $this.events( e ); }, /* * Events */ events: function( e ) { // Custom Events $this.wrap.on( 'click change keyup keydown', '.abr-metabox-repeater .attribute-name', $this.setSignature ); $this.wrap.on( 'click', '.abr-metabox-repeater .row-topbar', $this.toggleItems ); $this.wrap.on( 'click', '.abr-metabox-repeater .btn-remove-row', $this.removeRepeaterRow ); $this.wrap.on( 'click', '.abr-metabox-repeater .btn-add-row', $this.addRepeaterRow ); }, /* * Init metabox elements */ metaboxInit: function( e ) { // Add tabs for Meta Box (UI) $this.wrap.find( '.abr-metabox-tabs' ).tabs(); // Repeater sortable $this.wrap.find( '.abr-metabox-repeater tbody' ).sortable( { items: 'tr', placeholder: 'ui-state-highlight', handle: '.row-topbar, .row-handle', start: function( e, ui ) { ui.placeholder.height( ui.item.height() ); }, } ); }, /* * Toggle items */ toggleItems: function() { if ( $( this ).hasClass( 'closed' ) ) { $( this ).removeClass( 'closed' ); $( this ).siblings( '.row-fields' ).slideDown(); } else { $( this ).addClass( 'closed' ); $( this ).siblings( '.row-fields' ).slideUp(); } }, /* * Set signature */ setSignature: function() { var label = '' + $( this ).data( 'label' ) + ''; var value = $( this ).val() ? $( this ).val() : label; $( this ).parents( '.row-content' ).find( '.signature' ).html( value ); }, /* * Add repeater row */ addRepeaterRow: function() { var repeater = $( this ).siblings( '.abr-metabox-repeater-table' ) // Get html row. var html = repeater.find( 'tbody tr.hidden' ).html(); // Add new row. repeater.find( 'tbody' ).append( '
[vc_row css=”.vc_custom_1567786663348{margin-top: 40px !important;}”][vc_column width=”1\/2″][vc_single_image image=”17267″ img_size=”full” alignment=”center” css=”.vc_custom_1568407307098{margin-top: 20px !important;}”][\/vc_column][vc_column width=”1\/2″][vc_raw_html css=”.vc_custom_1568407123199{margin-top: 20px !important;}”]JTNDZGl2JTIwY2xhc3MlM0QlMjJ2Y19idG4zLWNvbnRhaW5lciUyMHZjX2J0bjMtY2VudGVyJTIwdmNfY3VzdG9tXzE1MzgxMTQ5ODc0NjAlMjIlMjBzdHlsZSUzRCUyMnRleHQtYWxpZ24lM0ElMjBjZW50ZXIlM0IlMjIlM0UlM0NhJTIwY2xhc3MlM0QlMjJ2Y19nZW5lcmFsJTIwdmNfYnRuMyUyMHZjX2J0bjMtc2l6ZS1tZCUyMHZjX2J0bjMtc2hhcGUtc3F1YXJlJTIwdmNfYnRuMy1zdHlsZS1jdXN0b20lMjIlMjBzdHlsZSUzRCUyMmJhY2tncm91bmQtY29sb3IlM0ElMjAlMjM1OEJCNDclM0IlMjBjb2xvciUzQSUyMCUyM2ZmZmZmZiUzQiUyMiUyMHRpdGxlJTNEJTIyJTIyJTIwaHJlZiUzRCUyMmh0dHBzJTNBJTJGJTJGd3d3Lmh5cGVyZmFybWVyLmNvbSUyRnNjaGVkdWxlLWEtY29uc3VsdGF0aW9uLWNhbGwlMkYlMjIlM0VTQ0hFRFVMRSUyMEElMjBDT05TVUxUQVRJT04lMjBDQUxMJTNDJTJGYSUzRSUzQyUyRmRpdiUzRSUwQQ==[\/vc_raw_html][\/vc_column][\/vc_row][vc_row full_width=”stretch_row” css=”.vc_custom_1567787017802{padding-top: 20px !important;padding-bottom: 20px !important;background-color: #58bb47 !important;}”][vc_column][vc_column_text]<\/p>\n
[\/vc_column_text][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n