build/js/script.min.js
// Don't move the document when pressing arrow keys on focused handles
Don't move the document when pressing arrow keys on focused handles
Don ' t move the document when pressing arrow keys on focused handles
function eventKeydown(event, handleNumber) {
      if (isSliderDisabled() || isHandleDisabled(handleNumber)) {
        return false;
      }
      var horizontalKeys = ["Left", "Right"];
      var verticalKeys = ["Down", "Up"];
      if (options.dir && !options.ort) {
        horizontalKeys.reverse();
      } else if (options.ort && !options.dir) {
        verticalKeys.reverse();
      } 
      var key = event.key.replace("Arrow", "");
      var isDown = key === verticalKeys[0] || key === horizontalKeys[0];
      var isUp = key === verticalKeys[1] || key === horizontalKeys[1];
      if (!isDown && !isUp) {
        return true;
      }
      event.preventDefault();
      var direction = isDown ? 0 : 1;
      var steps = getNextStepsForHandle(handleNumber);
      var step = steps[direction]; 
      if (step === null) {
        return false;
      } 
      if (step === false) {
        step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, 10);
      } 
      step = Math.max(step, 0.0000001); 
      step = (isDown ? -1 : 1) * step;
      setHandle(handleNumber, scope_Spectrum.toStepping(scope_Values[handleNumber] + step), true, true);
      fireEvent("slide", handleNumber);
      fireEvent("update", handleNumber);
      fireEvent("change", handleNumber);
      fireEvent("set", handleNumber);
      return false;
    } 
function eventKeydown ( event , handleNumber ) { if ( isSliderDisabled ( ) || isHandleDisabled ( handleNumber ) ) { return false ; } var horizontalKeys = [ "Left" , "Right" ] ; var verticalKeys = [ "Down" , "Up" ] ; if ( options . dir && ! options . ort ) { horizontalKeys . reverse ( ) ; } else if ( options . ort && ! options . dir ) { verticalKeys . reverse ( ) ; } var key = event . key . replace ( "Arrow" , "" ) ; var isDown = key === verticalKeys [ 0 ] || key === horizontalKeys [ 0 ] ; var isUp = key === verticalKeys [ 1 ] || key === horizontalKeys [ 1 ] ; if ( ! isDown && ! isUp ) { return true ; } event . preventDefault ( ) ; var direction = isDown ? 0 : 1 ; var steps = getNextStepsForHandle ( handleNumber ) ; var step = steps [ direction ] ; if ( step === null ) { return false ; } if ( step === false ) { step = scope_Spectrum . getDefaultStep ( scope_Locations [ handleNumber ] , isDown , 10 ) ; } step = Math . max ( step , 0.0000001 ) ; step = ( isDown ? - 1 : 1 ) * step ; setHandle ( handleNumber , scope_Spectrum . toStepping ( scope_Values [ handleNumber ] + step ) , true , true ) ; fireEvent ( "slide" , handleNumber ) ; fireEvent ( "update" , handleNumber ) ; fireEvent ( "change" , handleNumber ) ; fireEvent ( "set" , handleNumber ) ; return false ; }
Don't move the document when pressing arrow keys on focused handles
Don ' t move the document when pressing arrow keys on focused handles
// On an right-to-left slider, the left and right keys act inverted // On a top-to-bottom slider, the up and down keys act inverted // Strip "Arrow" for IE compatibility. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key // At the edge of a slider, do nothing // No step set, use the default of 10% of the sub-range // Step over zero-length ranges (#948); // Decrement for down steps // Attach events to several slider parts.