( function( api ) {
	// Extends our custom "real-estate-broker" section.
	api.sectionConstructor['real-estate-broker'] = 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 ResetChildDemoSettings() {
        if (!confirm("Are you sure you want to reset demo import settings?")) return;

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

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

(function ($, wp) {
    function ResetChildGlobalColor() {
        if (confirm("Are you sure you want to reset global color settings?")) {
            wp.customize.instance("real_estate_realtor_first_color").set("#18d5eb");
        }
    }

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