Ignore:
Timestamp:
Feb 18, 2013, 10:18:40 PM (11 years ago)
Author:
rvelices
Message:

upgraded jquery ui from 1.9.0 to 1.10.1

File:
1 edited

Legend:

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

    r18630 r20824  
    11/*!
    2  * jQuery UI Button 1.9.0
     2 * jQuery UI Button 1.10.1
    33 * http://jqueryui.com
    44 *
    5  * Copyright 2012 jQuery Foundation and other contributors
     5 * Copyright 2013 jQuery Foundation and other contributors
    66 * Released under the MIT license.
    77 * http://jquery.org/license
     
    3030                        radios = $( [] );
    3131                if ( name ) {
     32                        name = name.replace( /'/g, "\\'" );
    3233                        if ( form ) {
    3334                                radios = $( form ).find( "[name='" + name + "']" );
     
    4344
    4445$.widget( "ui.button", {
    45         version: "1.9.0",
     46        version: "1.10.1",
    4647        defaultElement: "<button>",
    4748        options: {
     
    7172                        options = this.options,
    7273                        toggleButton = this.type === "checkbox" || this.type === "radio",
    73                         hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ),
     74                        activeClass = !toggleButton ? "ui-state-active" : "",
    7475                        focusClass = "ui-state-focus";
    7576
     
    7778                        options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
    7879                }
     80
     81                this._hoverable( this.buttonElement );
    7982
    8083                this.buttonElement
     
    8588                                        return;
    8689                                }
    87                                 $( this ).addClass( "ui-state-hover" );
    8890                                if ( this === lastActive ) {
    8991                                        $( this ).addClass( "ui-state-active" );
     
    9496                                        return;
    9597                                }
    96                                 $( this ).removeClass( hoverClass );
     98                                $( this ).removeClass( activeClass );
    9799                        })
    98100                        .bind( "click" + this.eventNamespace, function( event ) {
     
    146148                                        return false;
    147149                                }
    148                                 $( this ).toggleClass( "ui-state-active" );
    149                                 that.buttonElement.attr( "aria-pressed", that.element[0].checked );
    150150                        });
    151151                } else if ( this.type === "radio" ) {
     
    192192                                        }
    193193                                })
    194                                 .bind( "keyup" + this.eventNamespace, function() {
     194                                // see #8559, we bind to blur here in case the button element loses
     195                                // focus between keydown and keyup, it would be left in an "active" state
     196                                .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
    195197                                        $( this ).removeClass( "ui-state-active" );
    196198                                });
     
    283285
    284286        refresh: function() {
    285                 var isDisabled = this.element.is( ":disabled" );
     287                //See #8237 & #8828
     288                var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
     289
    286290                if ( isDisabled !== this.options.disabled ) {
    287291                        this._setOption( "disabled", isDisabled );
     
    357361
    358362$.widget( "ui.buttonset", {
    359         version: "1.9.0",
     363        version: "1.10.1",
    360364        options: {
    361                 items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"
     365                items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
    362366        },
    363367
Note: See TracChangeset for help on using the changeset viewer.