( function( api ) {

	// Extends our custom "fast-food-truck" section.
	api.sectionConstructor['fast-food-truck'] = api.Section.extend( {

		// No events for this type of section.
		attachEvents: function () {},

		// Always make the section active.
		isContextuallyActive: function () {
			return true;
		}
	} );

} )( wp.customize );

(function ($) {
    function ResetDemoSettings() {
        if (!confirm("Are you sure you want to reset demo import settings?")) return;

        $.post(ajaxurl, { action: 'fast_food_truck_reset_demo_import_settings' }, function () {
            location.reload();
        });
    }

    window.ResetDemoSettings = ResetDemoSettings;
})(jQuery);

(function ($, wp) {
    function ResetGlobalColor() {
        if (confirm("Are you sure you want to reset global color settings?")) {
            wp.customize.instance("fast_food_truck_first_color").set("#BE2424");
			wp.customize.instance("fast_food_truck_second_color").set("#F1AA52");
        }
    }

    window.ResetGlobalColor = ResetGlobalColor;
})(jQuery, wp);
