Ignore:
Timestamp:
Oct 28, 2011, 3:25:54 PM (12 years ago)
Author:
patdenice
Message:

feature:2487
Update jQuery to 1.6.4 and jQuery UI to 1.8.16

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/js/ui/jquery.ui.slider.js

    r9559 r12525  
    11/*
    2  * jQuery UI Slider 1.8.10
     2 * jQuery UI Slider 1.8.16
    33 *
    44 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
     
    3737        _create: function() {
    3838                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 = [];
    4044
    4145                this._keySliding = false;
     
    5155                                " ui-widget" +
    5256                                " 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" : "" ) );
    5859
    5960                this.range = $([]);
     
    6162                if ( o.range ) {
    6263                        if ( o.range === true ) {
    63                                 this.range = $( "<div></div>" );
    6464                                if ( !o.values ) {
    6565                                        o.values = [ this._valueMin(), this._valueMin() ];
     
    6868                                        o.values = [ o.values[0], o.values[0] ];
    6969                                }
    70                         } else {
    71                                 this.range = $( "<div></div>" );
    72                         }
    73 
    74                         this.range
     70                        }
     71
     72                        this.range = $( "<div></div>" )
    7573                                .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 ) );
    10486
    10587                this.handle = this.handles.eq( 0 );
     
    467449                        this._refreshValue();
    468450                        this._change( null, 0 );
     451                        return;
    469452                }
    470453
     
    481464                        this._refreshValue();
    482465                        this._change( null, index );
     466                        return;
    483467                }
    484468
     
    519503                                        this.handles.filter( ".ui-state-focus" ).blur();
    520504                                        this.handles.removeClass( "ui-state-hover" );
    521                                         this.handles.attr( "disabled", "disabled" );
     505                                        this.handles.propAttr( "disabled", true );
    522506                                        this.element.addClass( "ui-disabled" );
    523507                                } else {
    524                                         this.handles.removeAttr( "disabled" );
     508                                        this.handles.propAttr( "disabled", false );
    525509                                        this.element.removeClass( "ui-disabled" );
    526510                                }
     
    593577                }
    594578                var step = ( this.options.step > 0 ) ? this.options.step : 1,
    595                         valModStep = (val - this._valueMin()) % step;
     579                        valModStep = (val - this._valueMin()) % step,
    596580                        alignValue = val - valModStep;
    597581
     
    677661
    678662$.extend( $.ui.slider, {
    679         version: "1.8.10"
     663        version: "1.8.16"
    680664});
    681665
Note: See TracChangeset for help on using the changeset viewer.