diff --git a/includes/js/widget-selector.js b/includes/js/widget-selector.js index 48aff25..5e6bff6 100644 --- a/includes/js/widget-selector.js +++ b/includes/js/widget-selector.js @@ -1,26 +1,28 @@ -function term_postback( select_id, taxonomy ) { +function term_postback ( select_id, taxonomy ) { 'use strict'; var data = { action: 'widget_selector', taxonomy: taxonomy }; - jQuery.post(displayfeaturedimagegenesis_ajax_object.ajax_url, data, function(response) { + jQuery.post( displayfeaturedimagegenesis_ajax_object.ajax_url, data, function ( response ) { // Decode the data received. - var list = jQuery.parseJSON(response); + var list = jQuery.parseJSON( response ); // Keep track of what was previously selected - var control = jQuery('#' + select_id); + var control = jQuery( '#' + select_id ); var old_value = control.val(); // Clear out the old options, build up the new control.empty(); - jQuery.each(list, function(key, value) { - var new_option = jQuery('') - .attr('value', key).text(value); - if (value == old_value) { - new_option.attr('selected', true); + jQuery.each( list, function ( key, value ) { + var new_option = jQuery( '").attr("value",e).text(t);t==o&&a.attr("selected",!0),r.append(a)}))}))} \ No newline at end of file +function term_postback(e,a){"use strict";var t={action:"widget_selector",taxonomy:a};jQuery.post(displayfeaturedimagegenesis_ajax_object.ajax_url,t,(function(a){var t=jQuery.parseJSON(a),r=jQuery("#"+e),n=r.val();r.empty(),jQuery.each(t,(function(e,a){var t=jQuery("