/**
 * Texture metabox range slider handlers
 * 
 * Syncs range slider values to number inputs in the texture CPT metabox.
 *
 * @package ProductCustomizer
 */

jQuery(document).ready(function($) {
    // Sync roughness slider to number input
    $(document).on('input', 'input[data-slider="roughness"]', function() {
        $('#dprcu_texture_roughness').val(this.value);
    });

    // Sync metalness slider to number input
    $(document).on('input', 'input[data-slider="metalness"]', function() {
        $('#dprcu_texture_metalness').val(this.value);
    });

    // Sync number inputs back to sliders
    $(document).on('input', '#dprcu_texture_roughness', function() {
        $('input[data-slider="roughness"]').val(this.value);
    });

    $(document).on('input', '#dprcu_texture_metalness', function() {
        $('input[data-slider="metalness"]').val(this.value);
    });
});
