(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1 || v.id.indexOf('hero_callout') > -1 || v.id.indexOf('section') > -1 ) return; if(thisVal == 'yes'){ $(v).fadeIn(); }else{ $(v).fadeOut(); } }); } // toggle the layout settings if($('body.wp-customizer')){ // when the setting is changed $('.js--toggle-layout-options input[type="radio"]').live('change', function(e){ var $this = $(this); var $parent = $this.closest('.control-section'); var thisVal = $this.val(); toggleLayoutSettings($parent, thisVal); refreshAlert(); }); // when the page loads var $activeToggles = $('.js--toggle-layout-options'); $activeToggles.each(function(k, v){ var $this = $(this); var $parent = $this.closest('.control-section'); var $radio = $this.find('input[type="radio"]:checked'); var thisVal = $radio.val(); toggleLayoutSettings($parent, thisVal); }); } },{}],7:[function(require,module,exports){ jQuery(function($) { if($('.js--widgetized-sortables').length <= 0) return; var $sortableList = $('.js--widgetized-sortables'); var $groupWrapper = $sortableList.closest('.sortables'); var siblingsName = $groupWrapper.find('.'+$sortableList.data('sortable-group')); var id = $sortableList.data('sortable-group').replace('_control', '_setting'); var $active = $groupWrapper.find('.js--sortables-active'); var $field = $groupWrapper.find('input[type="hidden"]'); // inits the sortable and does things $sortableList.sortable({ placeholder: 'ui-state-highlight', connectWith: siblingsName, change: function(e, u){ }, update: function(event, ui) { var $this = $(this); var activeComponentsStr = ''; activeComponentsStr = get_active_sortables($active); save_values(id, activeComponentsStr, $field) }, receive: function(e){} }); // when the visibility changes $('.sortable__visibility select').on('change', function(e){ var $this = $(this); var thisVal = $this.val(); $this.closest('.sortable').addClass('save-warning'); $('#submit').parent('.submit').addClass('save-warning'); var activeComponentsStr = get_active_sortables($active); save_values(id, activeComponentsStr, $field); }); // gets the active sortables and sets their settings/positions to a string to be saved function get_active_sortables($active){ var activeComponents = []; // loop through the active components and collect their data $active.find('li').each(function(idx) { var $thisComp = $(this); var component = $thisComp.attr('id'); var label = $thisComp.text(); $thisComp.addClass('save-warning'); activeComponents.push({ name: component, label: label }); }); // stringify the array into a string and return return JSON.stringify(activeComponents); } function save_values(key, activeComponentsStr, $field){ wp.customize( key, function ( obj ) { obj.set( activeComponentsStr ); } ); $field.val(activeComponentsStr); } }); },{}]},{},[1]);