Changeset 12525 for trunk/themes/default/js/ui/jquery.ui.slider.js
- Timestamp:
- Oct 28, 2011, 3:25:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/default/js/ui/jquery.ui.slider.js
r9559 r12525 1 1 /* 2 * jQuery UI Slider 1.8.1 02 * jQuery UI Slider 1.8.16 3 3 * 4 4 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) … … 37 37 _create: function() { 38 38 var self = this, 39 o = this.options; 39 o = this.options, 40 existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), 41 handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>", 42 handleCount = ( o.values && o.values.length ) || 1, 43 handles = []; 40 44 41 45 this._keySliding = false; … … 51 55 " ui-widget" + 52 56 " ui-widget-content" + 53 " ui-corner-all" ); 54 55 if ( o.disabled ) { 56 this.element.addClass( "ui-slider-disabled ui-disabled" ); 57 } 57 " ui-corner-all" + 58 ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); 58 59 59 60 this.range = $([]); … … 61 62 if ( o.range ) { 62 63 if ( o.range === true ) { 63 this.range = $( "<div></div>" );64 64 if ( !o.values ) { 65 65 o.values = [ this._valueMin(), this._valueMin() ]; … … 68 68 o.values = [ o.values[0], o.values[0] ]; 69 69 } 70 } else { 71 this.range = $( "<div></div>" ); 72 } 73 74 this.range 70 } 71 72 this.range = $( "<div></div>" ) 75 73 .appendTo( this.element ) 76 .addClass( "ui-slider-range" ); 77 78 if ( o.range === "min" || o.range === "max" ) { 79 this.range.addClass( "ui-slider-range-" + o.range ); 80 } 81 82 // note: this isn't the most fittingly semantic framework class for this element, 83 // but worked best visually with a variety of themes 84 this.range.addClass( "ui-widget-header" ); 85 } 86 87 if ( $( ".ui-slider-handle", this.element ).length === 0 ) { 88 $( "<a href='#'></a>" ) 89 .appendTo( this.element ) 90 .addClass( "ui-slider-handle" ); 91 } 92 93 if ( o.values && o.values.length ) { 94 while ( $(".ui-slider-handle", this.element).length < o.values.length ) { 95 $( "<a href='#'></a>" ) 96 .appendTo( this.element ) 97 .addClass( "ui-slider-handle" ); 98 } 99 } 100 101 this.handles = $( ".ui-slider-handle", this.element ) 102 .addClass( "ui-state-default" + 103 " ui-corner-all" ); 74 .addClass( "ui-slider-range" + 75 // note: this isn't the most fittingly semantic framework class for this element, 76 // but worked best visually with a variety of themes 77 " ui-widget-header" + 78 ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); 79 } 80 81 for ( var i = existingHandles.length; i < handleCount; i += 1 ) { 82 handles.push( handle ); 83 } 84 85 this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) ); 104 86 105 87 this.handle = this.handles.eq( 0 ); … … 467 449 this._refreshValue(); 468 450 this._change( null, 0 ); 451 return; 469 452 } 470 453 … … 481 464 this._refreshValue(); 482 465 this._change( null, index ); 466 return; 483 467 } 484 468 … … 519 503 this.handles.filter( ".ui-state-focus" ).blur(); 520 504 this.handles.removeClass( "ui-state-hover" ); 521 this.handles. attr( "disabled", "disabled");505 this.handles.propAttr( "disabled", true ); 522 506 this.element.addClass( "ui-disabled" ); 523 507 } else { 524 this.handles. removeAttr( "disabled");508 this.handles.propAttr( "disabled", false ); 525 509 this.element.removeClass( "ui-disabled" ); 526 510 } … … 593 577 } 594 578 var step = ( this.options.step > 0 ) ? this.options.step : 1, 595 valModStep = (val - this._valueMin()) % step ;579 valModStep = (val - this._valueMin()) % step, 596 580 alignValue = val - valModStep; 597 581 … … 677 661 678 662 $.extend( $.ui.slider, { 679 version: "1.8.1 0"663 version: "1.8.16" 680 664 }); 681 665
Note: See TracChangeset
for help on using the changeset viewer.