Changeset 20824 for trunk/themes/default/js/ui/jquery.ui.button.js
- Timestamp:
- Feb 18, 2013, 10:18:40 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/default/js/ui/jquery.ui.button.js
r18630 r20824 1 1 /*! 2 * jQuery UI Button 1. 9.02 * jQuery UI Button 1.10.1 3 3 * http://jqueryui.com 4 4 * 5 * Copyright 201 2jQuery Foundation and other contributors5 * Copyright 2013 jQuery Foundation and other contributors 6 6 * Released under the MIT license. 7 7 * http://jquery.org/license … … 30 30 radios = $( [] ); 31 31 if ( name ) { 32 name = name.replace( /'/g, "\\'" ); 32 33 if ( form ) { 33 34 radios = $( form ).find( "[name='" + name + "']" ); … … 43 44 44 45 $.widget( "ui.button", { 45 version: "1. 9.0",46 version: "1.10.1", 46 47 defaultElement: "<button>", 47 48 options: { … … 71 72 options = this.options, 72 73 toggleButton = this.type === "checkbox" || this.type === "radio", 73 hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ),74 activeClass = !toggleButton ? "ui-state-active" : "", 74 75 focusClass = "ui-state-focus"; 75 76 … … 77 78 options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html()); 78 79 } 80 81 this._hoverable( this.buttonElement ); 79 82 80 83 this.buttonElement … … 85 88 return; 86 89 } 87 $( this ).addClass( "ui-state-hover" );88 90 if ( this === lastActive ) { 89 91 $( this ).addClass( "ui-state-active" ); … … 94 96 return; 95 97 } 96 $( this ).removeClass( hoverClass );98 $( this ).removeClass( activeClass ); 97 99 }) 98 100 .bind( "click" + this.eventNamespace, function( event ) { … … 146 148 return false; 147 149 } 148 $( this ).toggleClass( "ui-state-active" );149 that.buttonElement.attr( "aria-pressed", that.element[0].checked );150 150 }); 151 151 } else if ( this.type === "radio" ) { … … 192 192 } 193 193 }) 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() { 195 197 $( this ).removeClass( "ui-state-active" ); 196 198 }); … … 283 285 284 286 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 286 290 if ( isDisabled !== this.options.disabled ) { 287 291 this._setOption( "disabled", isDisabled ); … … 357 361 358 362 $.widget( "ui.buttonset", { 359 version: "1. 9.0",363 version: "1.10.1", 360 364 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)" 362 366 }, 363 367
Note: See TracChangeset
for help on using the changeset viewer.