wp/wp-includes/js/jquery/ui/slider.js
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
     1 /*!
     1 /*!
     2  * jQuery UI Slider 1.13.1
     2  * jQuery UI Slider 1.13.3
     3  * http://jqueryui.com
     3  * https://jqueryui.com
     4  *
     4  *
     5  * Copyright jQuery Foundation and other contributors
     5  * Copyright OpenJS Foundation and other contributors
     6  * Released under the MIT license.
     6  * Released under the MIT license.
     7  * http://jquery.org/license
     7  * https://jquery.org/license
     8  */
     8  */
     9 
     9 
    10 //>>label: Slider
    10 //>>label: Slider
    11 //>>group: Widgets
    11 //>>group: Widgets
    12 //>>description: Displays a flexible slider with ranges and accessibility via keyboard.
    12 //>>description: Displays a flexible slider with ranges and accessibility via keyboard.
    13 //>>docs: http://api.jqueryui.com/slider/
    13 //>>docs: https://api.jqueryui.com/slider/
    14 //>>demos: http://jqueryui.com/slider/
    14 //>>demos: https://jqueryui.com/slider/
    15 //>>css.structure: ../../themes/base/core.css
    15 //>>css.structure: ../../themes/base/core.css
    16 //>>css.structure: ../../themes/base/slider.css
    16 //>>css.structure: ../../themes/base/slider.css
    17 //>>css.theme: ../../themes/base/theme.css
    17 //>>css.theme: ../../themes/base/theme.css
    18 
    18 
    19 ( function( factory ) {
    19 ( function( factory ) {
    23 
    23 
    24 		// AMD. Register as an anonymous module.
    24 		// AMD. Register as an anonymous module.
    25 		define( [
    25 		define( [
    26 			"jquery",
    26 			"jquery",
    27 			"./mouse",
    27 			"./mouse",
    28 			"./core"
    28 			"../keycode",
       
    29 			"../version",
       
    30 			"../widget"
    29 		], factory );
    31 		], factory );
    30 	} else {
    32 	} else {
    31 
    33 
    32 		// Browser globals
    34 		// Browser globals
    33 		factory( jQuery );
    35 		factory( jQuery );
    34 	}
    36 	}
    35 } )( function( $ ) {
    37 } )( function( $ ) {
    36 "use strict";
    38 "use strict";
    37 
    39 
    38 return $.widget( "ui.slider", $.ui.mouse, {
    40 return $.widget( "ui.slider", $.ui.mouse, {
    39 	version: "1.13.1",
    41 	version: "1.13.3",
    40 	widgetEventPrefix: "slide",
    42 	widgetEventPrefix: "slide",
    41 
    43 
    42 	options: {
    44 	options: {
    43 		animate: false,
    45 		animate: false,
    44 		classes: {
    46 		classes: {
   640 		} else {
   642 		} else {
   641 			value = this.value();
   643 			value = this.value();
   642 			valueMin = this._valueMin();
   644 			valueMin = this._valueMin();
   643 			valueMax = this._valueMax();
   645 			valueMax = this._valueMax();
   644 			valPercent = ( valueMax !== valueMin ) ?
   646 			valPercent = ( valueMax !== valueMin ) ?
   645 				( value - valueMin ) / ( valueMax - valueMin ) * 100 :
   647 					( value - valueMin ) / ( valueMax - valueMin ) * 100 :
   646 				0;
   648 					0;
   647 			_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
   649 			_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
   648 			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
   650 			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
   649 
   651 
   650 			if ( oRange === "min" && this.orientation === "horizontal" ) {
   652 			if ( oRange === "min" && this.orientation === "horizontal" ) {
   651 				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
   653 				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {