Advertisement
Guest User

jQuery UI Slider Overlapping Handles Patched Version

a guest
Apr 17th, 2013
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*!
  2.  * jQuery UI Slider 1.10.2
  3.  * http://jqueryui.com
  4.  *
  5.  * Copyright 2013 jQuery Foundation and other contributors
  6.  * Released under the MIT license.
  7.  * http://jquery.org/license
  8.  *
  9.  * http://api.jqueryui.com/slider/
  10.  *
  11.  * Depends:
  12.  *  jquery.ui.core.js
  13.  *  jquery.ui.mouse.js
  14.  *  jquery.ui.widget.js
  15.  */
  16. (function( $, undefined ) {
  17.  
  18. // number of pages in a slider
  19. // (how many times can you page up/down to go through the whole range)
  20. var numPages = 5;
  21.  
  22. $.widget( "ui.slider", $.ui.mouse, {
  23.     version: "1.10.2",
  24.     widgetEventPrefix: "slide",
  25.  
  26.     options: {
  27.         animate: false,
  28.         distance: 0,
  29.         max: 100,
  30.         min: 0,
  31.         orientation: "horizontal",
  32.         range: false,
  33.         step: 1,
  34.         value: 0,
  35.         values: null,
  36.  
  37.         // callbacks
  38.         change: null,
  39.         slide: null,
  40.         start: null,
  41.         stop: null
  42.     },
  43.  
  44.     _create: function() {
  45.         this._keySliding = false;
  46.         this._mouseSliding = false;
  47.         this._animateOff = true;
  48.         this._handleIndex = null;
  49.         this._chooseHandle = null;
  50.         this._detectOrientation();
  51.         this._mouseInit();
  52.  
  53.         this.element
  54.             .addClass( "ui-slider" +
  55.                 " ui-slider-" + this.orientation +
  56.                 " ui-widget" +
  57.                 " ui-widget-content" +
  58.                 " ui-corner-all");
  59.  
  60.         this._refresh();
  61.         this._setOption( "disabled", this.options.disabled );
  62.  
  63.         this._animateOff = false;
  64.     },
  65.  
  66.     _refresh: function() {
  67.         this._createRange();
  68.         this._createHandles();
  69.         this._setupEvents();
  70.         this._refreshValue();
  71.     },
  72.  
  73.     _createHandles: function() {
  74.         var i, handleCount,
  75.             options = this.options,
  76.             existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
  77.             handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
  78.             handles = [];
  79.  
  80.         handleCount = ( options.values && options.values.length ) || 1;
  81.  
  82.         if ( existingHandles.length > handleCount ) {
  83.             existingHandles.slice( handleCount ).remove();
  84.             existingHandles = existingHandles.slice( 0, handleCount );
  85.         }
  86.  
  87.         for ( i = existingHandles.length; i < handleCount; i++ ) {
  88.             handles.push( handle );
  89.         }
  90.  
  91.         this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
  92.  
  93.         this.handle = this.handles.eq( 0 );
  94.  
  95.         this.handles.each(function( i ) {
  96.             $( this ).data( "ui-slider-handle-index", i );
  97.         });
  98.     },
  99.  
  100.     _createRange: function() {
  101.         var options = this.options,
  102.             classes = "";
  103.  
  104.         if ( options.range ) {
  105.             if ( options.range === true ) {
  106.                 if ( !options.values ) {
  107.                     options.values = [ this._valueMin(), this._valueMin() ];
  108.                 } else if ( options.values.length && options.values.length !== 2 ) {
  109.                     options.values = [ options.values[0], options.values[0] ];
  110.                 } else if ( $.isArray( options.values ) ) {
  111.                     options.values = options.values.slice(0);
  112.                 }
  113.             }
  114.  
  115.             if ( !this.range || !this.range.length ) {
  116.                 this.range = $( "<div></div>" )
  117.                     .appendTo( this.element );
  118.  
  119.                 classes = "ui-slider-range" +
  120.                 // note: this isn't the most fittingly semantic framework class for this element,
  121.                 // but worked best visually with a variety of themes
  122.                 " ui-widget-header ui-corner-all";
  123.             } else {
  124.                 this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
  125.                     // Handle range switching from true to min/max
  126.                     .css({
  127.                         "left": "",
  128.                         "bottom": ""
  129.                     });
  130.             }
  131.  
  132.             this.range.addClass( classes +
  133.                 ( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
  134.         } else {
  135.             this.range = $([]);
  136.         }
  137.     },
  138.  
  139.     _setupEvents: function() {
  140.         var elements = this.handles.add( this.range ).filter( "a" );
  141.         this._off( elements );
  142.         this._on( elements, this._handleEvents );
  143.         this._hoverable( elements );
  144.         this._focusable( elements );
  145.     },
  146.  
  147.     _destroy: function() {
  148.         this.handles.remove();
  149.         this.range.remove();
  150.  
  151.         this.element
  152.             .removeClass( "ui-slider" +
  153.                 " ui-slider-horizontal" +
  154.                 " ui-slider-vertical" +
  155.                 " ui-widget" +
  156.                 " ui-widget-content" +
  157.                 " ui-corner-all" );
  158.  
  159.         this._mouseDestroy();
  160.     },
  161.  
  162.     _mouseCapture: function( event ) {
  163.         var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
  164.             that = this,
  165.             o = this.options;
  166.  
  167.         if ( o.disabled ) {
  168.             return false;
  169.         }
  170.  
  171.         this.elementSize = {
  172.             width: this.element.outerWidth(),
  173.             height: this.element.outerHeight()
  174.         };
  175.         this.elementOffset = this.element.offset();
  176.  
  177.         position = { x: event.pageX, y: event.pageY };
  178.         normValue = this._normValueFromMouse( position );
  179.         distance = this._valueMax() - this._valueMin() + 1;
  180.         this.handles.each(function( i ) {
  181.             var thisDistance = Math.abs( normValue - that.values(i) );
  182.             if (( distance > thisDistance ) ||
  183.                 ( distance === thisDistance &&
  184.                     (i === that._lastChangedValue || that.values(i) === o.min ))) {
  185.                 distance = thisDistance;
  186.                 closestHandle = $( this );
  187.                 index = i;
  188.             }
  189.         });
  190.  
  191.         allowed = this._start( event, index );
  192.         if ( allowed === false ) {
  193.             return false;
  194.         }
  195.         this._mouseSliding = true;
  196.  
  197.         this._handleIndex = index;
  198.  
  199.         closestHandle
  200.             .addClass( "ui-state-active" )
  201.             .focus();
  202.  
  203.         offset = closestHandle.offset();
  204.         mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
  205.         this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
  206.             left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
  207.             top: event.pageY - offset.top -
  208.                 ( closestHandle.height() / 2 ) -
  209.                 ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
  210.                 ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
  211.                 ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
  212.         };
  213.  
  214.         if ( !this.handles.hasClass( "ui-state-hover" ) ) {
  215.             this._slide( event, index, normValue );
  216.         }
  217.         this._animateOff = true;
  218.         return true;
  219.     },
  220.  
  221.     _mouseStart: function() {
  222.         var values = this.values();
  223.        
  224.         this._chooseHandle = ( this.handles.length === 2 ) && ( values[0] === values[1] );
  225.        
  226.         return true;
  227.     },
  228.  
  229.     _mouseDrag: function( event ) {
  230.         var position = { x: event.pageX, y: event.pageY },
  231.             normValue = this._normValueFromMouse( position ),
  232.             values = this.values();
  233.        
  234.         if ( this._chooseHandle && ( normValue !== values[0] ) )
  235.         {
  236.             this._handleIndex = normValue < values[0] ? 0 : 1;
  237.             this._chooseHandle = false;
  238.         }
  239.        
  240.         this._slide( event, this._handleIndex, normValue );
  241.  
  242.         return false;
  243.     },
  244.  
  245.     _mouseStop: function( event ) {
  246.         this.handles.removeClass( "ui-state-active" );
  247.         this._mouseSliding = false;
  248.  
  249.         this._stop( event, this._handleIndex );
  250.         this._change( event, this._handleIndex );
  251.  
  252.         this._handleIndex = null;
  253.         this._clickOffset = null;
  254.         this._animateOff = false;
  255.  
  256.         return false;
  257.     },
  258.  
  259.     _detectOrientation: function() {
  260.         this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
  261.     },
  262.  
  263.     _normValueFromMouse: function( position ) {
  264.         var pixelTotal,
  265.             pixelMouse,
  266.             percentMouse,
  267.             valueTotal,
  268.             valueMouse;
  269.  
  270.         if ( this.orientation === "horizontal" ) {
  271.             pixelTotal = this.elementSize.width;
  272.             pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
  273.         } else {
  274.             pixelTotal = this.elementSize.height;
  275.             pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
  276.         }
  277.  
  278.         percentMouse = ( pixelMouse / pixelTotal );
  279.         if ( percentMouse > 1 ) {
  280.             percentMouse = 1;
  281.         }
  282.         if ( percentMouse < 0 ) {
  283.             percentMouse = 0;
  284.         }
  285.         if ( this.orientation === "vertical" ) {
  286.             percentMouse = 1 - percentMouse;
  287.         }
  288.  
  289.         valueTotal = this._valueMax() - this._valueMin();
  290.         valueMouse = this._valueMin() + percentMouse * valueTotal;
  291.  
  292.         return this._trimAlignValue( valueMouse );
  293.     },
  294.  
  295.     _start: function( event, index ) {
  296.         var uiHash = {
  297.             handle: this.handles[ index ],
  298.             value: this.value()
  299.         };
  300.         if ( this.options.values && this.options.values.length ) {
  301.             uiHash.value = this.values( index );
  302.             uiHash.values = this.values();
  303.         }
  304.         return this._trigger( "start", event, uiHash );
  305.     },
  306.  
  307.     _slide: function( event, index, newVal ) {
  308.         var otherVal,
  309.             newValues,
  310.             allowed;
  311.  
  312.         if ( this.options.values && this.options.values.length ) {
  313.             otherVal = this.values( index ? 0 : 1 );
  314.  
  315.             if ( ( this.options.values.length === 2 && this.options.range === true ) &&
  316.                     ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
  317.                 ) {
  318.                 newVal = otherVal;
  319.             }
  320.  
  321.             if ( newVal !== this.values( index ) ) {
  322.                 newValues = this.values();
  323.                 newValues[ index ] = newVal;
  324.                 // A slide can be canceled by returning false from the slide callback
  325.                 allowed = this._trigger( "slide", event, {
  326.                     handle: this.handles[ index ],
  327.                     value: newVal,
  328.                     values: newValues
  329.                 } );
  330.                 otherVal = this.values( index ? 0 : 1 );
  331.                 if ( allowed !== false ) {
  332.                     this.values( index, newVal, true );
  333.                 }
  334.             }
  335.         } else {
  336.             if ( newVal !== this.value() ) {
  337.                 // A slide can be canceled by returning false from the slide callback
  338.                 allowed = this._trigger( "slide", event, {
  339.                     handle: this.handles[ index ],
  340.                     value: newVal
  341.                 } );
  342.                 if ( allowed !== false ) {
  343.                     this.value( newVal );
  344.                 }
  345.             }
  346.         }
  347.     },
  348.  
  349.     _stop: function( event, index ) {
  350.         var uiHash = {
  351.             handle: this.handles[ index ],
  352.             value: this.value()
  353.         };
  354.         if ( this.options.values && this.options.values.length ) {
  355.             uiHash.value = this.values( index );
  356.             uiHash.values = this.values();
  357.         }
  358.  
  359.         this._trigger( "stop", event, uiHash );
  360.     },
  361.  
  362.     _change: function( event, index ) {
  363.         if ( !this._keySliding && !this._mouseSliding ) {
  364.             var uiHash = {
  365.                 handle: this.handles[ index ],
  366.                 value: this.value()
  367.             };
  368.             if ( this.options.values && this.options.values.length ) {
  369.                 uiHash.value = this.values( index );
  370.                 uiHash.values = this.values();
  371.             }
  372.  
  373.             //store the last changed value index for reference when handles overlap
  374.             this._lastChangedValue = index;
  375.  
  376.             this._trigger( "change", event, uiHash );
  377.         }
  378.     },
  379.  
  380.     value: function( newValue ) {
  381.         if ( arguments.length ) {
  382.             this.options.value = this._trimAlignValue( newValue );
  383.             this._refreshValue();
  384.             this._change( null, 0 );
  385.             return;
  386.         }
  387.  
  388.         return this._value();
  389.     },
  390.  
  391.     values: function( index, newValue ) {
  392.         var vals,
  393.             newValues,
  394.             i;
  395.  
  396.         if ( arguments.length > 1 ) {
  397.             this.options.values[ index ] = this._trimAlignValue( newValue );
  398.             this._refreshValue();
  399.             this._change( null, index );
  400.             return;
  401.         }
  402.  
  403.         if ( arguments.length ) {
  404.             if ( $.isArray( arguments[ 0 ] ) ) {
  405.                 vals = this.options.values;
  406.                 newValues = arguments[ 0 ];
  407.                 for ( i = 0; i < vals.length; i += 1 ) {
  408.                     vals[ i ] = this._trimAlignValue( newValues[ i ] );
  409.                     this._change( null, i );
  410.                 }
  411.                 this._refreshValue();
  412.             } else {
  413.                 if ( this.options.values && this.options.values.length ) {
  414.                     return this._values( index );
  415.                 } else {
  416.                     return this.value();
  417.                 }
  418.             }
  419.         } else {
  420.             return this._values();
  421.         }
  422.     },
  423.  
  424.     _setOption: function( key, value ) {
  425.         var i,
  426.             valsLength = 0;
  427.  
  428.         if ( key === "range" && this.options.range === true ) {
  429.             if ( value === "min" ) {
  430.                 this.options.value = this._values( 0 );
  431.                 this.options.values = null;
  432.             } else if ( value === "max" ) {
  433.                 this.options.value = this._values( this.options.values.length-1 );
  434.                 this.options.values = null;
  435.             }
  436.         }
  437.  
  438.         if ( $.isArray( this.options.values ) ) {
  439.             valsLength = this.options.values.length;
  440.         }
  441.  
  442.         $.Widget.prototype._setOption.apply( this, arguments );
  443.  
  444.         switch ( key ) {
  445.             case "orientation":
  446.                 this._detectOrientation();
  447.                 this.element
  448.                     .removeClass( "ui-slider-horizontal ui-slider-vertical" )
  449.                     .addClass( "ui-slider-" + this.orientation );
  450.                 this._refreshValue();
  451.                 break;
  452.             case "value":
  453.                 this._animateOff = true;
  454.                 this._refreshValue();
  455.                 this._change( null, 0 );
  456.                 this._animateOff = false;
  457.                 break;
  458.             case "values":
  459.                 this._animateOff = true;
  460.                 this._refreshValue();
  461.                 for ( i = 0; i < valsLength; i += 1 ) {
  462.                     this._change( null, i );
  463.                 }
  464.                 this._animateOff = false;
  465.                 break;
  466.             case "min":
  467.             case "max":
  468.                 this._animateOff = true;
  469.                 this._refreshValue();
  470.                 this._animateOff = false;
  471.                 break;
  472.             case "range":
  473.                 this._animateOff = true;
  474.                 this._refresh();
  475.                 this._animateOff = false;
  476.                 break;
  477.         }
  478.     },
  479.  
  480.     //internal value getter
  481.     // _value() returns value trimmed by min and max, aligned by step
  482.     _value: function() {
  483.         var val = this.options.value;
  484.         val = this._trimAlignValue( val );
  485.  
  486.         return val;
  487.     },
  488.  
  489.     //internal values getter
  490.     // _values() returns array of values trimmed by min and max, aligned by step
  491.     // _values( index ) returns single value trimmed by min and max, aligned by step
  492.     _values: function( index ) {
  493.         var val,
  494.             vals,
  495.             i;
  496.  
  497.         if ( arguments.length ) {
  498.             val = this.options.values[ index ];
  499.             val = this._trimAlignValue( val );
  500.  
  501.             return val;
  502.         } else if ( this.options.values && this.options.values.length ) {
  503.             // .slice() creates a copy of the array
  504.             // this copy gets trimmed by min and max and then returned
  505.             vals = this.options.values.slice();
  506.             for ( i = 0; i < vals.length; i+= 1) {
  507.                 vals[ i ] = this._trimAlignValue( vals[ i ] );
  508.             }
  509.  
  510.             return vals;
  511.         } else {
  512.             return [];
  513.         }
  514.     },
  515.  
  516.     // returns the step-aligned value that val is closest to, between (inclusive) min and max
  517.     _trimAlignValue: function( val ) {
  518.         if ( val <= this._valueMin() ) {
  519.             return this._valueMin();
  520.         }
  521.         if ( val >= this._valueMax() ) {
  522.             return this._valueMax();
  523.         }
  524.         var step = ( this.options.step > 0 ) ? this.options.step : 1,
  525.             valModStep = (val - this._valueMin()) % step,
  526.             alignValue = val - valModStep;
  527.  
  528.         if ( Math.abs(valModStep) * 2 >= step ) {
  529.             alignValue += ( valModStep > 0 ) ? step : ( -step );
  530.         }
  531.  
  532.         // Since JavaScript has problems with large floats, round
  533.         // the final value to 5 digits after the decimal point (see #4124)
  534.         return parseFloat( alignValue.toFixed(5) );
  535.     },
  536.  
  537.     _valueMin: function() {
  538.         return this.options.min;
  539.     },
  540.  
  541.     _valueMax: function() {
  542.         return this.options.max;
  543.     },
  544.  
  545.     _refreshValue: function() {
  546.         var lastValPercent, valPercent, value, valueMin, valueMax,
  547.             oRange = this.options.range,
  548.             o = this.options,
  549.             that = this,
  550.             animate = ( !this._animateOff ) ? o.animate : false,
  551.             _set = {};
  552.  
  553.         if ( this.options.values && this.options.values.length ) {
  554.             this.handles.each(function( i ) {
  555.                 valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
  556.                 _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
  557.                 $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
  558.                 if ( that.options.range === true ) {
  559.                     if ( that.orientation === "horizontal" ) {
  560.                         if ( i === 0 ) {
  561.                             that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
  562.                         }
  563.                         if ( i === 1 ) {
  564.                             that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
  565.                         }
  566.                     } else {
  567.                         if ( i === 0 ) {
  568.                             that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
  569.                         }
  570.                         if ( i === 1 ) {
  571.                             that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
  572.                         }
  573.                     }
  574.                 }
  575.                 lastValPercent = valPercent;
  576.             });
  577.         } else {
  578.             value = this.value();
  579.             valueMin = this._valueMin();
  580.             valueMax = this._valueMax();
  581.             valPercent = ( valueMax !== valueMin ) ?
  582.                     ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
  583.                     0;
  584.             _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
  585.             this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
  586.  
  587.             if ( oRange === "min" && this.orientation === "horizontal" ) {
  588.                 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
  589.             }
  590.             if ( oRange === "max" && this.orientation === "horizontal" ) {
  591.                 this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
  592.             }
  593.             if ( oRange === "min" && this.orientation === "vertical" ) {
  594.                 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
  595.             }
  596.             if ( oRange === "max" && this.orientation === "vertical" ) {
  597.                 this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
  598.             }
  599.         }
  600.     },
  601.  
  602.     _handleEvents: {
  603.         keydown: function( event ) {
  604.             /*jshint maxcomplexity:25*/
  605.             var allowed, curVal, newVal, step,
  606.                 index = $( event.target ).data( "ui-slider-handle-index" );
  607.  
  608.             switch ( event.keyCode ) {
  609.                 case $.ui.keyCode.HOME:
  610.                 case $.ui.keyCode.END:
  611.                 case $.ui.keyCode.PAGE_UP:
  612.                 case $.ui.keyCode.PAGE_DOWN:
  613.                 case $.ui.keyCode.UP:
  614.                 case $.ui.keyCode.RIGHT:
  615.                 case $.ui.keyCode.DOWN:
  616.                 case $.ui.keyCode.LEFT:
  617.                     event.preventDefault();
  618.                     if ( !this._keySliding ) {
  619.                         this._keySliding = true;
  620.                         $( event.target ).addClass( "ui-state-active" );
  621.                         allowed = this._start( event, index );
  622.                         if ( allowed === false ) {
  623.                             return;
  624.                         }
  625.                     }
  626.                     break;
  627.             }
  628.  
  629.             step = this.options.step;
  630.             if ( this.options.values && this.options.values.length ) {
  631.                 curVal = newVal = this.values( index );
  632.             } else {
  633.                 curVal = newVal = this.value();
  634.             }
  635.  
  636.             switch ( event.keyCode ) {
  637.                 case $.ui.keyCode.HOME:
  638.                     newVal = this._valueMin();
  639.                     break;
  640.                 case $.ui.keyCode.END:
  641.                     newVal = this._valueMax();
  642.                     break;
  643.                 case $.ui.keyCode.PAGE_UP:
  644.                     newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) );
  645.                     break;
  646.                 case $.ui.keyCode.PAGE_DOWN:
  647.                     newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) );
  648.                     break;
  649.                 case $.ui.keyCode.UP:
  650.                 case $.ui.keyCode.RIGHT:
  651.                     if ( curVal === this._valueMax() ) {
  652.                         return;
  653.                     }
  654.                     newVal = this._trimAlignValue( curVal + step );
  655.                     break;
  656.                 case $.ui.keyCode.DOWN:
  657.                 case $.ui.keyCode.LEFT:
  658.                     if ( curVal === this._valueMin() ) {
  659.                         return;
  660.                     }
  661.                     newVal = this._trimAlignValue( curVal - step );
  662.                     break;
  663.             }
  664.  
  665.             this._slide( event, index, newVal );
  666.         },
  667.         click: function( event ) {
  668.             event.preventDefault();
  669.         },
  670.         keyup: function( event ) {
  671.             var index = $( event.target ).data( "ui-slider-handle-index" );
  672.  
  673.             if ( this._keySliding ) {
  674.                 this._keySliding = false;
  675.                 this._stop( event, index );
  676.                 this._change( event, index );
  677.                 $( event.target ).removeClass( "ui-state-active" );
  678.             }
  679.         }
  680.     }
  681.  
  682. });
  683.  
  684. }(jQuery));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement