wp.customize.controlConstructor['paws-and-care-range-slider'] = wp.customize.Control.extend({

	ready: function() {
		'use strict';

		var control = this,
			slider = control.container.find( '.paws-and-care-range-slider-range' ),
			output = control.container.find( '.paws-and-care-range-slider-value' );

		// When range slider changes, update number input and save
		slider.on( 'input', function() {
			var value = jQuery( this ).val();
			output.val( value );
			control.setting.set( value );
		});

		// When number input changes, update range slider and save
		output.on( 'input change', function() {
			var value = jQuery( this ).val();
			slider.val( value );
			control.setting.set( value );
		});

		// Reset button
		if ( control.params.default !== false ) {
			var reset = control.container.find( '.paws-and-care-range-reset-slider' );

			reset.on( 'click', function() {
				slider.val( control.params.default );
				output.val( control.params.default );
				control.setting.set( control.params.default );
			});
		}
	}

});
